View Single Post
Old 09-05-2008   #1 (permalink)
karsagarwal


 
 

run 2 dos commands using vbScript as a single command

Hi,
I am trying to change the directory and then run another command all
in 1 line. But for some strange reason I can't even get the first
command to work. I need help!!

SA


Here's the code
===========
dim objShell
dim inFile, outFile, projFile,folderC ,cmd1,cmd2

'setting variuos paths
folderC ="C:\temp\Projects\21038Ax1aDx"
inFile = "C:\Documents and Settings\smitha\My Documents\BOM
\partlist.ini"
outFile = "out.lst"
projFile = "10297200"

'2 commands
cmd1= "cd folderC"
cmd2="partlist projFile -input inFile -outFile outFile"

set objshell = createobject("Wscript.shell")
objshell.Run "%compsec% /k cmd1 & cmd2"
My System SpecsSystem Spec