Current script folder

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

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 9 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.
Locked
User avatar
clum09
Posts: 150
Last visit: Sun Jan 21, 2024 5:07 pm

Current script folder

Post by clum09 »

Hello,

I tried the script packager in PrimalScript 2007 to package a vbscript that outputs a log file to the current folder.

Because the script has to extract the packaged executable file into a temporary folder before it launches and the temporary folder that I pointed to during packaging the script is different from current folder, the log file generated by the packaged script is not in the current folder where the packaged script resides.

How can I package the script and have the output file placed in the current folder as the packaged script?

Thanks for the help.


User avatar
clum09
Posts: 150
Last visit: Sun Jan 21, 2024 5:07 pm

Current script folder

Post by clum09 »

Hello,

I tried the script packager in PrimalScript 2007 to package a vbscript that outputs a log file to the current folder.

Because the script has to extract the packaged executable file into a temporary folder before it launches and the temporary folder that I pointed to during packaging the script is different from current folder, the log file generated by the packaged script is not in the current folder where the packaged script resides.

How can I package the script and have the output file placed in the current folder as the packaged script?

Thanks for the help.


jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Current script folder

Post by jvierra »

Repackage and specify the target folder as teh location to unpack the script to. It only uses temp as a default and this can be changed in the packager.

Select "Folders" tab and change selection to "Same folder as the location of teh executable file"

This will make the packager work the way you expect.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Current script folder

Post by jvierra »

Unfortuanately for you the "current" folder is relative to the script location and NOT to the exe location. The script knows nothing about the EXE as it is added by PrimalScript after-the-fact.

Either accept the curent two conditions or specify an exact folder to extract the script to. There are no other options.

As I remember ASE can only use the EV on the system creating the package and not on the target systems. It just sets a specific folder to output to.

If you have issues about the operation of PrimalScript or other Sapien products you need to post them to http://support.sapien.com/forum/.

Sorry.


User avatar
clum09
Posts: 150
Last visit: Sun Jan 21, 2024 5:07 pm

Current script folder

Post by clum09 »

With ASE, I can have the packaged script (the file with the .exe) to extract the tool files, icon file and the script file to another folder while the log files generatesd by the script will be placed in the folder where the packaged script resides. I have to use an environment variable from ASE in order to point the output log files to the packaged script's folder. This will make the packaged script act like a stand-alone program in stead of seeing the icon file, the tool executable files and the extracted script file in the folder where the packaged script (the one with the .exe exntension) resides.

The "SAPIEN Script Host" does not allow the script to add another files such as the icon file and another utility files to the packaged script.

I would like to see Primal Script to do the same as ASE.

Will there be any change in Primal SCript 2009 as far as outputing the log files to the packaged script's folder?
User avatar
Alexander Riedel
Posts: 8478
Last visit: Tue Mar 26, 2024 8:52 am
Answers: 19
Been upvoted: 37 times

Current script folder

Post by Alexander Riedel »

PrimalScript's packager has always allowed to add auxiliary files to a package. It also provides the means for custom icons, always has. I am not sure what you are missing.
If you mean redirecting the output of a script, the standard output can be redirected as as with any command line application.
The included manual would also make a good starting point.
But once again, this here is not a PrimalScript support forum, you really should take this to support.sapien.com
Alexander Riedel
SAPIEN Technologies, Inc.
This topic is 14 years and 9 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.
Locked