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 LICENSE NUMBERS, ACTIVATION 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.
This topic is 14 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
ginolard
Posts: 34
Last visit: Tue Jun 21, 2022 12:06 am

Bug in running scripts on network path

Post 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?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Bug in running scripts on network path

Post 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
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
ginolard
Posts: 34
Last visit: Tue Jun 21, 2022 12:06 am

Bug in running scripts on network path

Post 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
User avatar
ginolard
Posts: 34
Last visit: Tue Jun 21, 2022 12:06 am

Bug in running scripts on network path

Post 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
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Bug in running scripts on network path

Post 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.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
ginolard
Posts: 34
Last visit: Tue Jun 21, 2022 12:06 am

Bug in running scripts on network path

Post by ginolard »

H: maps to an entirely different server (i.e. my home drive on the network)Here's the screenshot.
User avatar
ginolard
Posts: 34
Last visit: Tue Jun 21, 2022 12:06 am

Bug in running scripts on network path

Post 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 ;)
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Bug in running scripts on network path

Post 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
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Bug in running scripts on network path

Post 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 :-)
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
ginolard
Posts: 34
Last visit: Tue Jun 21, 2022 12:06 am

Bug in running scripts on network path

Post 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
This topic is 14 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.