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
# 8  
Old 01-14-2009
bhagya2340,

Can you please elaborate your problem. It seems that you want to put a file from windows box to unix box? and execute from there? Am i correct in saying that?

And after executing the file in UNIX what will happen. Others may provide you better solution if you can give us info.

Cheers!
# 9  
Old 01-14-2009
Alright, tell me if I understood you correctly. You want the script to
  1. Connect to the Windows server to start a batch file, which generates some CSV files
  2. Use FTP to move those files to a UNIX box

If this is correct, you need some way to login to the Windows server that doesn't require a graphic environment, eg. telnet, rsh, ssh. AFAIK some versions of Windows already provide a telnet server, Windows Services for Unix provides an rsh server, OpenSSH for Windows is a subset of the Cygwin installation that provides a SSH server for Windows.

Your script would have to do the following:
  1. Remote to the Windows server
  2. Run your batch file
  3. FTP the results
Note that you have to start the batch file before you start the FTP session, as FTP can't run any host commands.
# 10  
Old 01-14-2009
You are right.... the problem is that i dont know how to do first 2 steps... I have telnet on my system... can you say me how i can get connedted to my remote windows server and run my batchfile....
I can FTP the results... thats not the problem...
# 11  
Old 01-14-2009
It doesn't matter if you have telnet on your box or not, the Windows server has to provide some means for remote login. Choose one of telnet/rsh/ssh and install the appropriate server on Windows.
# 12  
Old 01-14-2009
Thanks a lot... I know ypu are trying to help me... but no new softwares cannot be installed in my system.
If i can also the code will work on my sytem but when it goes to Production it will not as they dont have the software...so...
Is there an possible way that i can just open a .xls file on windows using FTP of Unix...

Actually i have written a macro in my .xls it runs if the file is just opened... so is there a possible way to just open it so it produces the required .csv file....
# 13  
Old 01-14-2009
No. FTP is file transfer only. To open the .xls file you would have to invoke a command on the Windows server, which isn't possible.
The only alternative I see is to move execution control to the Windows server. Run your batch file there, and when it's done telnet into the unix-box and call the FTP script.
# 14  
Old 01-14-2009
Excatly this how its done now.... Its all manually... we want to automate the process...so we can put it on cron tab at a perticular time...

Anways Thanks... if you this any other way please let me know....
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