<karsagarwal@xxxxxx> wrote in message
news:f32b7bf8-f730-416d-82d6-9064066febff@xxxxxx
Quote:
> 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"
Replace the line
objshell.Run "%compsec% /k cmd1 & cmd2" with this line:
wscript.echo "%compsec% /k cmd1 & cmd2"
and you will immediately see that the command cannot possibly run, because
"cd folderC" gets lumped together with "partlist".
You probably have a second problem too. Where is the command processor
supposed to find "partlist"? In the current folder? What is the current
folder? In scripts you MUST state the drive, folder, file name and
extension!