Page 1 of 2

Bug in running scripts on network path

Posted: Wed May 13, 2009 1:24 am
by ginolard
I have noticed this before but thought it was a one-off. After opening several scripts via UNC paths, when I try to run a script that was opened from a hard-coded network drive I get the messageInput Error: Can not find script file "<UNCPath>myscript.vbs".For example, say I open script1 from SERVER1PackagesScriptsscript1.vbs and also open script2 from "H:scriptsscript2.vbs"Sometimes, when trying to run script2 I will get the error Input Error: Can not find script file "SERVER1PackagesScriptsscript2.vbs".Any ideas?

Bug in running scripts on network path

Posted: Wed May 13, 2009 1:32 am
by Alexander Riedel
So this is an error message from your script and not from PrimalScript, correct?

I am not sure from your post if you are trying to run script2 from PrimalScript or from Script1.

Alex

Bug in running scripts on network path

Posted: Wed May 13, 2009 4:35 am
by ginolard
Sorry, everything is run from within Primalscript.Script1 and Script2 are both open. Script1 was opened using a UNC path. Script2 was opened from a mapped drive.Sometimes, when trying to run Script2 it appears to look for it in the UNC path of script1. Most odd.I shall try to reproduce it tomorrow and take a screenshot

Bug in running scripts on network path

Posted: Wed May 13, 2009 6:25 pm
by ginolard
Here you go. The Outlook2003.vbs scripts is in a folder called HHBRUA061NsstorePackagesMicrosoft Office 2003ScriptsThe pcowner.vbs script is in a folder called H:ScriptingWhen I try to run the Pcowner.vbs (using CTRL+F5) it seems to be looking for it in the folder of the Outlook2003.vbs script

Bug in running scripts on network path

Posted: Wed May 13, 2009 6:32 pm
by Alexander Riedel
That would be rather odd if it would mix up path names.
Two questions:
1. What does H: actually map to?
2. Can you show a screenshot of Tools - Options - Environment - Languages - VBScript ?

I suspect it just tries to execute the script in the "current" directory and the mix of UNC and mapped path names throws something off.

I can tell more when I see the actual settings.

Bug in running scripts on network path

Posted: Wed May 13, 2009 7:41 pm
by ginolard
H: maps to an entirely different server (i.e. my home drive on the network)Here's the screenshot.

Bug in running scripts on network path

Posted: Wed May 13, 2009 7:43 pm
by ginolard
I just changed the InitialDirectory to be $FileDir$ and this seems to have resolved the problem.Still seems like a bug to me though ;)

Bug in running scripts on network path

Posted: Wed May 13, 2009 7:45 pm
by Alexander Riedel
Ok, the initial directory field contains
$FileDir$
by default, guess you somehow removed that.
Set that again and try.

If that does not help, replace
"$FileName$" with "$File$"
(with the quotes).

Alex

Bug in running scripts on network path

Posted: Wed May 13, 2009 7:49 pm
by Alexander Riedel
No, not really a bug. You removed the specification where to run the script. PrimalScript launches CScript with the filename (with no path specified) and faithfully looks in the current folder and complains if it isn't there.

It was just doing what it was told :-)

Bug in running scripts on network path

Posted: Wed May 13, 2009 7:59 pm
by ginolard
Hmm, I don't remember removing anything. I think it's always been like that.Oh well, maybe I did and just forgot in my old age