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.
Locked
User avatar
clum09
Posts: 150
Joined: Thu Apr 24, 2008 9:11 am

Current script folder

Post by clum09 » Fri May 29, 2009 6:09 am

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
Joined: Thu Apr 24, 2008 9:11 am

Current script folder

Post by clum09 » Fri May 29, 2009 6:09 am

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: 13992
Joined: Tue May 22, 2007 9:57 am
Contact:

Current script folder

Post by jvierra » Fri May 29, 2009 6:14 am

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: 13992
Joined: Tue May 22, 2007 9:57 am
Contact:

Current script folder

Post by jvierra » Fri May 29, 2009 9:00 am

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
Joined: Thu Apr 24, 2008 9:11 am

Current script folder

Post by clum09 » Sat May 30, 2009 5:24 am

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: 7121
Joined: Tue May 29, 2007 4:43 pm

Current script folder

Post by Alexander Riedel » Sat May 30, 2009 5:41 am

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.

Locked