how to bypass exe path to script

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 9 years and 3 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
manyone
Posts: 4
Last visit: Sun Jun 07, 2015 12:24 am

how to bypass exe path to script

Post by manyone »

is it possible to bypass the path of the executable to the unpacked executed script ?
User avatar
SAPIEN Support Forums
Posts: 945
Last visit: Thu Oct 22, 2015 1:10 pm

how to bypass exe path to script

Post by SAPIEN Support Forums »

This is an automated post. A real person will respond soon.

Thank you for posting, manyone.

Here are some hints to help you get an accurate and complete answer to your question.

Ask in the best forum: If you asked in the wrong forum, just copy your question to the right forum.

Anticipate follow-up questions!

Did you remember to include the following?
  • 1. Product, version and build
    2. 32 or 64 bit product
    3. Operating system, e.g. Windows 7 64 bit.
    4. Attach a screenshot, if applicable
    5. Attach logs, crash reports, etc., in a ZIP file
If not, please take a moment to edit your original post or reply to this one.

*** Make sure you do not post any licensing information ***
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: how to bypass exe path to script

Post by jvierra »

manyone wrote:is it possible to bypass the path of the executable to the unpacked executed script ?
I cannot tell what you are asking from the question. What do you mean by "bypass"? "Bypass" what?
User avatar
manyone
Posts: 4
Last visit: Sun Jun 07, 2015 12:24 am

Re: how to bypass exe path to script

Post by manyone »

explanation:
i have packaged a hta script with PS
this executable is anywhere in the filesystem, let's say x:\any\where\script.exe

this exe is unpacked at execution time to c:\temp\12345.hta

but i need to know the path of the executable in the script, so the question again:
is it possible to give this information at execution time to the unpacked script (as argument/parameter or anything else) ?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: how to bypass exe path to script

Post by jvierra »

The script name and locations are here: window.location

Verify by adding this to the load procedure

MsgBox window.location
User avatar
manyone
Posts: 4
Last visit: Sun Jun 07, 2015 12:24 am

Re: how to bypass exe path to script

Post by manyone »

that is not correct, the window.location hold the path of the unpacked script file and not the path of the packed executable.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: how to bypass exe path to script

Post by jvierra »

I know. You cannot easily change that vehavior. YOu can run the exe like this and get the arguments and parse them:

MyHta.exe %cd%
User avatar
manyone
Posts: 4
Last visit: Sun Jun 07, 2015 12:24 am

Re: how to bypass exe path to script

Post by manyone »

i know that but what, if i need to doubleclick the exe by mouse or with rightclick to elevate the exe as another user or administrator rights ? It does not work.
i thought, that in an older version a system argument exists, which can passed to the script as argument, but i dont remember.
perhaps i think about a feature of another script packager.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: how to bypass exe path to script

Post by jvierra »

I don't know of any option but then I don't know everything about this packager used with an HTA.

You can post in Customer Service to see if the Sapien people have any ideas on how to get what you need.
This topic is 9 years and 3 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