Calling a .bat file using Korn script


 
Thread Tools Search this Thread
Special Forums Windows & DOS: Issues & Discussions Calling a .bat file using Korn script
# 1  
Old 01-08-2009
Calling a .bat file using Korn script

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 script that runs my .vbs file...
can anyone say me how to do that
the .bat and .vbs files are on windows. Even the created new .cvs file is also placed on windows.
Below code cotains my .bat and .vbs files

.bat
Code:
 
start /w wscript.exe \\pb-a-024\xyz.vbs

.vbs
Code:
Dim xlApp, xlBook, xlSht 
Dim filename

filename = "\\pb-a-024\xyz.xls"
Set xlApp = CreateObject("Excel.Application")
set xlBook = xlApp.WorkBooks.Open(filename)
set xlSht = xlApp.activesheet

'xlBook.Close False
xlApp.Quit
'always deallocate after use...
set xlSht = Nothing 
Set xlBook = Nothing
Set xlApp = Nothing

Please enlight be how to slove this issue

Thanking You
Bhagya
# 2  
Old 01-13-2009
Do you have ksh installed on Windows? If so, is it via cygwin or SCO or mks?
# 3  
Old 01-13-2009
I am sorry i dont know that... can ypu say me how i can check that....??
Actually we have a cron which we use for sheduling the .ksh scripts on Unix box... now i have a .bat or .vbs file on my windows server which i want to trigger using ksh or corn so the conversion of file for .xls to .csv is done automatically.
I general we do FTP all of files form windows to Unixbox using FTP code in our ksh scripts... is there anyway i can trigger this bat file form cron or by Ksh script...

Please enlight me...
# 4  
Old 01-13-2009
SO you have 2 servers? A windows box and a unix box...

You want the unix box to trigger a script on the windows box?
# 5  
Old 01-13-2009
Yes.... Excatly.. i want to trigger a bat file on my windows form a ksh script on my Unix...

can i use rsh command in FTP to do this triggering...I already have FTP commection in my script which gets me a file generated by the bat file which i want to trigger form unix script...So i want to rsh command to run my bat file which generated .csv file which is then FTPed to Unix form windows...if i can please explain me'

Thanks
# 6  
Old 01-13-2009
Are you running a rsh daemon on the windows box?

Just use the scheduler on the windows box.
# 7  
Old 01-13-2009
Mmmm no i thought about it.... actually we are going to put this Ksh script on cron tab... so we want the ksh script to trigger the bat file so it generates the required file which is then FTPed to unix box...
When i say triggering i mean it should run the bat file...
I dont know about rsh daemon on windows... I am thinking to have rsh command in between my ftp.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling sqlplus from Korn shell heredoc issue

Hi, I am facing an issue wherein some temporary files (here docs) are getting created in /tmp and are not getting deleted automatically. When i check the list of open files with below command i can see one file is getting appended continuously.(In this case /tmp/sfe7h.34p) The output is... (4 Replies)
Discussion started by: Navin_Ramdhami
4 Replies

2. Shell Programming and Scripting

Multithreading - Calling user function with xargs in korn shell

I know there are other ways of accomplishing the below task, but the purpose of this thread is to understand the below code. I wanted to use xargs with user defined function in korn shell. Am aware, that I could write custom function into a script and place it in FPATH and then call it in xargs,... (2 Replies)
Discussion started by: luhah
2 Replies

3. Shell Programming and Scripting

Validate file count in korn shell script

Hi, I have files in the directory like below which I need to validate if all the required files are present. A_B_001 of 002_time1.txt A_B_002 of 002_time1.txt A_B_001 of 001_time2.txt Scenarios- a)If file with 001 of 002_time1 or 002 of 002_time1 is missing in the folder,script should... (6 Replies)
Discussion started by: aneeta13
6 Replies

4. Shell Programming and Scripting

Split file based on file size in Korn script

I need to split a file if it is over 2GB in size (or any size), preferably split on the lines. I have figured out how to get the file size using awk, and I can split the file based on the number of lines (which I got with wc -l) but I can't figure out how to connect them together in the script. ... (6 Replies)
Discussion started by: ssemple2000
6 Replies

5. UNIX for Advanced & Expert Users

Calling PERL from a Korn shell script

I am currently in Afghanistan and do not have access to some of the resources I normally do back in the US. Just accessed this site and it looks promising! Hopefully you will not find my question too much of a waste of your time. I write mostly Korn Shell and PERL on Solaris systems for the... (2 Replies)
Discussion started by: mseanowen
2 Replies

6. Shell Programming and Scripting

Write output to a file using Korn shell script

All, Can anyone please help me with the below scenario in korn shell script. Can anyone please give me some hints to proceed on this. I have a Flat file of the below format. Input file format:... (1 Reply)
Discussion started by: sp999
1 Replies

7. Windows & DOS: Issues & Discussions

.bat script help

hi I need to rediret an content of one file and append it to another file. I need it in .bat script. I tried this, first.txt I love to write script type first.txt >> out.txt type first.txt >> out.txt out.txt I love to write scriptI love to write script you see the... (6 Replies)
Discussion started by: ilugopal
6 Replies

8. Shell Programming and Scripting

.bat or .pl script help

hi I need to rediret an content of one file and append it to another file. I need it in .bat script. I tried this, first.txt I love to write script type first.txt >> out.txt type first.txt >> out.txt out.txt I love to write scriptI love to write script you see the second... (1 Reply)
Discussion started by: ilugopal
1 Replies

9. Shell Programming and Scripting

Run shell script from .bat file

hi how can I execute a shell script on unix server from a .bat file of windows desktop?? Regards. (3 Replies)
Discussion started by: Chaitrali
3 Replies

10. UNIX for Dummies Questions & Answers

korn shell script to keep history of same file

Hello, How do I write a korn shell that will rename file with the current date. What I want to do is, I have a file that is re-written every day. But instead, I want to keep a 14 day history of the file. So I want to write a script that will rename the current file with a date attached to the... (2 Replies)
Discussion started by: watson2000
2 Replies
Login or Register to Ask a Question