Bug in running scripts on network path

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
User avatar
ginolard
Posts: 34
Joined: Wed Jan 30, 2008 11:44 pm

Bug in running scripts on network path

Post by ginolard » Wed May 13, 2009 1:24 am

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?

User avatar
Alexander Riedel
Posts: 7106
Joined: Tue May 29, 2007 4:43 pm

Bug in running scripts on network path

Post by Alexander Riedel » Wed May 13, 2009 1:32 am

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
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
ginolard
Posts: 34
Joined: Wed Jan 30, 2008 11:44 pm

Bug in running scripts on network path

Post by ginolard » Wed May 13, 2009 4:35 am

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

User avatar
ginolard
Posts: 34
Joined: Wed Jan 30, 2008 11:44 pm

Bug in running scripts on network path

Post by ginolard » Wed May 13, 2009 6:25 pm

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

User avatar
Alexander Riedel
Posts: 7106
Joined: Tue May 29, 2007 4:43 pm

Bug in running scripts on network path

Post by Alexander Riedel » Wed May 13, 2009 6:32 pm

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.
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
ginolard
Posts: 34
Joined: Wed Jan 30, 2008 11:44 pm

Bug in running scripts on network path

Post by ginolard » Wed May 13, 2009 7:41 pm

H: maps to an entirely different server (i.e. my home drive on the network)Here's the screenshot.

User avatar
ginolard
Posts: 34
Joined: Wed Jan 30, 2008 11:44 pm

Bug in running scripts on network path

Post by ginolard » Wed May 13, 2009 7:43 pm

I just changed the InitialDirectory to be $FileDir$ and this seems to have resolved the problem.Still seems like a bug to me though ;)

User avatar
Alexander Riedel
Posts: 7106
Joined: Tue May 29, 2007 4:43 pm

Bug in running scripts on network path

Post by Alexander Riedel » Wed May 13, 2009 7:45 pm

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
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
Alexander Riedel
Posts: 7106
Joined: Tue May 29, 2007 4:43 pm

Bug in running scripts on network path

Post by Alexander Riedel » Wed May 13, 2009 7:49 pm

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 :-)
Alexander Riedel
SAPIEN Technologies, Inc.

User avatar
ginolard
Posts: 34
Joined: Wed Jan 30, 2008 11:44 pm

Bug in running scripts on network path

Post by ginolard » Wed May 13, 2009 7:59 pm

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