R
Rahul
Hi,
I have question regarding VBScript.
I want to exceute a command-line command from VBScript
but I want to execute this command from a particular
directory.
I mean I need to execute mycommand from path:
C:\dir1\dir2>mycommand.
Now my VBScript is in say D:\dir3.
So in my VBScript I need to navigate to path: C:\dir1\dir2
and then execute mycommand.
I dont know how to navigate to another directory thru
VBScript. I tried pushd but it doesnot work.
This is what I tried:
Set WSHShell = CreateObject("WScript.Shell")
sShell = WSHShell.Environment("Process").Item("COMSPEC")
pushcmd = "pushd " & dirname
'dirname is the directory I 'need to get in
WSHShell.Run sShell & " /c " & pushcmd, 0, True
But this doesnot work.
Is there any other way to navigate to a directory thru
VBScript.
Can anyone please help.
Thanks,
Rahul.
I have question regarding VBScript.
I want to exceute a command-line command from VBScript
but I want to execute this command from a particular
directory.
I mean I need to execute mycommand from path:
C:\dir1\dir2>mycommand.
Now my VBScript is in say D:\dir3.
So in my VBScript I need to navigate to path: C:\dir1\dir2
and then execute mycommand.
I dont know how to navigate to another directory thru
VBScript. I tried pushd but it doesnot work.
This is what I tried:
Set WSHShell = CreateObject("WScript.Shell")
sShell = WSHShell.Environment("Process").Item("COMSPEC")
pushcmd = "pushd " & dirname
'dirname is the directory I 'need to get in
WSHShell.Run sShell & " /c " & pushcmd, 0, True
But this doesnot work.
Is there any other way to navigate to a directory thru
VBScript.
Can anyone please help.
Thanks,
Rahul.