The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 05-26-2009
cjsewell cjsewell is offline
Registered User
  
 

Join Date: May 2009
Posts: 1
Lightbulb Executing KSH batch file located in specific folder

Ok apologies if this is trivial or doesn't make sense but I am quite new to korn shells;

So I have a .ksh batch file located in a folder of my choosing, I want to run this file in a korn shell.

The problem though is that I want to get VBA code to do this. I have (VBA) code which opens command prompt (cmd.exe) and runs a (one) command line.

So far I can get the kornshell to open, using the command line; "C:\\WINDOWS\\system32\\POSIX.EXE /u /c /bin/ksh -l". This opens the korn shell in a default directory. I guess I need to add to this line to get it to then go to the specified folder (which i obtain from the VBA code) and execute the batch file.

Looking around on the web I got the code below, but I can't get it to work; "C:\\WINDOWS\\system32\\POSIX.EXE /u /c /bin/ksh -l -c \"cd \\\"`chgpath -p '%L'`\\\";ksh\""

Any help would be greatly appreciated.
(Also could someone explain to me what each part of the above command actually does)

Thanks Chris