Page 1 of 1

how to bypass exe path to script

Posted: Tue Dec 09, 2014 9:51 am
by manyone
is it possible to bypass the path of the executable to the unpacked executed script ?

how to bypass exe path to script

Posted: Tue Dec 09, 2014 9:51 am
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 ***

Re: how to bypass exe path to script

Posted: Tue Dec 09, 2014 10:36 am
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?

Re: how to bypass exe path to script

Posted: Wed Dec 10, 2014 6:47 am
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) ?

Re: how to bypass exe path to script

Posted: Wed Dec 10, 2014 7:42 am
by jvierra
The script name and locations are here: window.location

Verify by adding this to the load procedure

MsgBox window.location

Re: how to bypass exe path to script

Posted: Wed Dec 10, 2014 10:04 am
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.

Re: how to bypass exe path to script

Posted: Wed Dec 10, 2014 10:18 am
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%

Re: how to bypass exe path to script

Posted: Wed Dec 10, 2014 12:00 pm
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.

Re: how to bypass exe path to script

Posted: Wed Dec 10, 2014 1:25 pm
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.