| |
kzseatttle
Posts: 1
Score: 0
Joined: 4/19/2007
Status: offline
|
Hello, I have a VB script, say, A.wsf that launches another script, say, B.wsf The code in A.wsf looks like this: WshShell.Run "cscript.exe B.wsf", 1, true A.wsf and B.wsf are in the same directory. Let's assume the directory is c:\scripts The problem is that this only works if I run A.wsf from c:\scripts. If I run it from any other location, say, c:\, then this does not work. Apparently, WshShell considers the path to B.wsf relative to the directory from where I run the script and not relative to the directory that contains A.wsf. So if I run A.wsf as this: c:\cscript scripts\A.wsf then WshShell will try to find B.wsf under c:\ and not under c:\scripts. I thought WshShell will try to find B.wsf from the same directory as the caller but that doesnt seem to be the case. Is there any work around for this WITHOUT modifying A.wsf or B.wsf or moving them around? Is there a way to force cscript find B.wsf under in the same directory as A.wsf?
|
|