locked
Cannot run an exe file in RunOnce RRS feed

  • Question

  • I put a ps1 file in HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce on a Windows 7 PC with powershell 1.0

    The file include a few exe files. After logging in, the ps1 script run all the exe files OK except one that shows AutoIt Error:

    Line -1:

    Error: Subscript used with non-Array variable.

    I tried to put only one line in the script just running this exe file and got the same error.

    I tried to run it with no luck by using

    C:\app.exe, &C:\app.exe or Start-Process C:\app.exe

    However I can manually run this ps1 file or exe OK

    Friday, April 19, 2013 5:34 PM

Answers

All replies

  • could you post this script?
    Friday, April 19, 2013 5:41 PM
  • Start-Process "C:\app.exe" -Verb runAs -Wait

    the ps1 file only contains above.


    OK, it may not be Powershell issue because I directly put c:\app.exe in RunOnce and got the same error.
    • Edited by Ian3 Friday, April 19, 2013 6:07 PM
    Friday, April 19, 2013 5:51 PM
  • Hi,

    Do you use a standard user?

    Standard user: RunOnce and RunOnceEx are not being executed

    http://support.microsoft.com/kb/2021405

    Regards,

    Yan Li


    Cataleya Li
    TechNet Community Support

    • Marked as answer by Yan Li_ Monday, April 29, 2013 2:26 AM
    Wednesday, April 24, 2013 6:08 AM