Can rsh command be used to call a bat file


 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions Can rsh command be used to call a bat file
# 1  
Old 01-13-2009
Can rsh command be used to call a bat file

I have a .bat file on windows, which converts a .xls file into .csv file and using a ksh script i would usually FTP this .csv file...

Now i want to trigger this .bat form my ksh script.

can i use rsh command in my FTP to run .bat file on windows and then ftp the generated .csv file...is this possibel..

If so please explain me...

Thanks..
# 2  
Old 01-13-2009
Nope. Windows usually does not provide any remote administration service that isn't graphics based. You could try to install OpenSSH or Telnet on the Windows server to remote in and start the batch file.
# 3  
Old 01-13-2009
I have Telnet using which i connect to the Unix and do my work...
can you say me more about how i can use telnet, unix to start my batch file
# 4  
Old 01-13-2009
You would have to have telnet server running on the windows box and create a script to connect to the windows box and run the script....

Why not just use the windows scheduler.
# 5  
Old 01-13-2009
I dont know when i told my team lead she said no

Ok can i use telent in between ftp to start something on windoes like this
telnet C:\test\bhagya.bat in my FTP
will this start my bat file to work and give me the rewuired out put...
# 6  
Old 01-13-2009
FTP will not execute a file on the remote server. FTP is for transferring files, not executing.
# 7  
Old 01-13-2009
Yes... this is my FTP
Code:
FTP_FILE_NAME="LTC*.csv"
FTP_DIR_NAME="ProviderReject"
ONE_MORE="SI_Notification_Reports"
PRESENT_DIR=`pwd`
FTP_STATS="${LOG_DIR}/FTP_Provider_Rej.stats"
FTP_ERR="${LOG_DIR}/FTP_Provider_Rej.error"
ftp -nv ${SI_NOTIFICATION_FTP_IP} > ${FTP_STATS} 2> ${FTP_ERR} <<EOF 
user ${SI_NOTIFICATION_FTP_USER} ${SI_NOTIFICATION_FTP_PASSWORD}
cd ${ONE_MORE}
cd ${FTP_DIR_NAME} 
bin
lcd ${DATA_DIR}
pwd
dir
prompt off
mget ${FTP_FILE_NAME}  
mdelete ${FTP_FILE_NAME}
prompt on
dir
EOF

if [[ -f $FTP_ERR ]] && [[ ! -s $FTP_ERR ]]     
then                                            
  rm -f ${FTP_ERR}                              
fi

here i am going to that location where the bat file is so can i put my telnet statment to run .bat file like this

cd ${ONE_MORE}
cd ${FTP_DIR_NAME}

Here telenet statement to run bat file

bin
lcd ${DATA_DIR}
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

Help required for Running SQLPLUS command from Bat file

Hello All, Good Afternoon. I am new to this platform and I need one small help regarding running a SQL file from Bat file. Below is what I am doing, 1. I placed the below command in one Bat file. start putty.exe -ssh user@host -pw pwd -m C:\2.txt 2. In 2.txt, I have below command. ... (3 Replies)
Discussion started by: PavanPatil
3 Replies

2. Shell Programming and Scripting

Need help with bat file!!!

I need to put/get files from Windows machine to Unix machine and vice-versa. I wrote a text file "ftp1.txt" as below. naga naga06 cd /root/Naga prom off get time.unl bye I wrote another bat file "ftp.bat" as below. ftp -n -s:C:\Users\Naga\Desktop\ftp1.txt IP_ADDRESS but... (2 Replies)
Discussion started by: Naga06
2 Replies

3. Windows & DOS: Issues & Discussions

Executing .bat file

Hi , I have a bat file on windows machine ,I need to excute it from my local unix machine using sambe utility.Is there any comman to execute the .bat file remotely. Using samba utility i can post files to and fro from windows to unix but i don't comman to exute the .bat file. can any one... (2 Replies)
Discussion started by: Raamc
2 Replies

4. Programming

how to call dot c file using system command

Hi every one, i have to dot pc files. One have main function but one dont have.I have to call dot pc file using system () cmd.File is being call have main function.Please let me know how i can call .pc file with two arguments from other dot pc file.I want some thing like sprintf(buf, "ss_xxx.pc... (4 Replies)
Discussion started by: goraya430
4 Replies

5. Shell Programming and Scripting

how to call dot c file using system command

Hi every one, i have to dot pc files. One have main function but one dont have.I have to call dot pc file using system () cmd.File is being call have main function.Please let me know how i can call .pc file with two arguments from other dot pc file.I want some thing like sprintf(buf,... (1 Reply)
Discussion started by: goraya430
1 Replies

6. Windows & DOS: Issues & Discussions

How to call a command in a batch file?

Hi, I would like to get the output of below command emailed to me in a windows2003 server. "bpimagelist -hoursago 24 -U" I will be using "blat" to email the output of this command.But not sure how the above command is called for in a batch file when executed. Would appreciate if... (1 Reply)
Discussion started by: Hari_Ganesh
1 Replies

7. Shell Programming and Scripting

Simple bat file

Hi guys, I need a *.bat to run a ksh file in the shell on Windows NT...nothing more :) How do I do it? I tried with the following but it failed: set INFORMIXDIR=D:\user-applications\informix set PATH=%INFORMIXDIR%;%PATH% D:\user-applications\MKS\mksnt\sh.exe C:\hk_9.2\C3_weekly_auto.ksh... (4 Replies)
Discussion started by: Dird
4 Replies

8. Shell Programming and Scripting

how to call a .bat file using KSH

Hi all, I am a very new user for korn scripting and in a process of learning. i have a .bat file that calls a .vbs file which calls a macro used to convert an excel spread sheet to .csv file... Now i want to automate this process. I want to call this bat file using a korn script or a korn... (16 Replies)
Discussion started by: bhagya2340
16 Replies

9. Windows & DOS: Issues & Discussions

one question for .bat file

Hi! I'm very sorry for such simple and silly question but I cannot answer it by myself. Can you please help me? In .bat file I should run the C program which is in other directory, and the input configuration file is in this directory too. This dir name is in dirRun variable. The... (3 Replies)
Discussion started by: Anta
3 Replies

10. Shell Programming and Scripting

executing *.bat file on windows from Unix box via ftp command

I have created get_list.bat file containing following line: dir /B /O-d >file_list.txt I am executing ftp command from Unix box and transferring get_list.bat file to windows server. In my next ftp command I am trying to execute this test.bat file by entering this line: get_list or by... (9 Replies)
Discussion started by: alx
9 Replies
Login or Register to Ask a Question