Close
Showing results 1 to 6 of 6

Hybrid View

  1. #1

    Default An annoyance I've found with the <Run> command

    ISBoxer has a nice feature, in that you can launch your copies of WoW from just one folder, and it'll swap in different config files, in order to give each one different settings (such as the account to start up with).


    I tried duplicating this in HKN, by having it run a powershell script to modify the config.wtf file before WoW is launched.

    Every time I try this through HKN the running of the script fails with a "File cannot be loaded because the execution of scripts is disabled on this system" error.

    The running of scripts is not disabled. I have set the execution policy for scripts on this system to unrestricted. Every other method of running scripts, such as through an unelevated command prompt, or even a guest account, works, as they should with it set to unrestricted.

    Why is it that HKN, even when run as administrator, can't manage to run scripts at the priviledge level set for the system?


    Currently the only work around I can find, is to put the 'run as' command into the HKN script with my system password. That is completely unacceptable. I am willing to give a program I trust admin rights when it is run, but I am not going to put my system password anywhere in the file system in plain text.
    WoW had a Cataclysm.
    I quit.


    Now 3-boxing EVE until CCP mess that up.

  2. #2

    Default

    I don't have HKN running as administrator and I am doing similar activities, I don't specify any "as" operator to Run as well

  3. #3

    Default

    Quote Originally Posted by Mukade View Post
    Every time I try this through HKN the running of the script fails with a "File cannot be loaded because the execution of scripts is disabled on this system" error.
    That error message is coming from the operating system. HotkeyNet is simply relaying it to you.

    If you post your hotkey definition here, maybe somebody can help you. There is no way for me to guess why you are having this problem because you didn't show the command that is causing the operating system to generate the error message.
    Last edited by Freddie : 11-25-2010 at 11:48 AM
    �Author of HotkeyNet and Mojo

  4. #4

    Default

    Yep it was the OS.

    I'd set execution poilicy to unrestricted both from powershell launched from the start menu's run box, and from the .exe file in the windows folder, and kept getting that error, even though both said the change had worked.

    The solution was to launch PS from inside HKN without a script passed to it, and then set the execution policy from that window (which is now back to remotesigned).

    Nowhere in any of the powershell documentation on execution policy did it say anything other than that once set, it would apply for the entire system (and I must have spent about 3 hours reading it).
    WoW had a Cataclysm.
    I quit.


    Now 3-boxing EVE until CCP mess that up.

  5. #5

    Default

    My guess is that this behavior is caused by PowerShell's concept of session state which is documented a little bit on MSDN. The reason you're seeing different behavior with HotkeyNet's "Run" and "run as" syntax is because HotkeyNet uses the OS's CreateProcess API in the first case and CreateProcessWithLogonW in the second case. (This is documented on HotkeyNet's website.) If you look up those APIs on MSDN, you'll see that in the first case, PowerShell runs in HotkeyNet's security context but in the second case, it runs in the account's security context. My guess is, in the first case, the OS starts a new session state from scratch, but in the second case, where your account credentials are used, PowerShell uses a global state belonging to the account.

    You may be able to avoid the whole problem by starting PowerShell with HotkeyNet's "Open" command because it uses the OS's ShellExecute API.
    �Author of HotkeyNet and Mojo

  6. #6

    Default

    Using Open didn't have the desired results either.

    Anyway, it's working now, and I've got yet another reason not to move on to ISBoxer
    WoW had a Cataclysm.
    I quit.


    Now 3-boxing EVE until CCP mess that up.

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •