Jump to content

After reboot desktop doesnt open when autoIT is in RunOnce


 Share

Recommended Posts

I have an autoIT script in the runonce. After the reboot, the autoIT script runs and stops the desktop from displaying.

I can kill the autoIT script and my desktop comes up right away.

Any way to fix this?

Or any suggestions to get an autoIT script to run automatically after login?

Thanks,

kubie

Link to comment
Share on other sites

  • Developers

That is how RUNONCE works. The loading of other stuff will only start after the RUNONCE program finished.

if you want to start the script and the desktop to appear you need to put it in RUN.

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Welcome,

Lets be clear about this vague use of RunOnce mentioned in the topic. Is this RunOnce in HKCU hive? i.e "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce" which continues to the desktop or is this in HKLM hive? i.e "HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce" which halts until end of execution, then continues to the desktop? Or is this the infamous RunOnce that some use that is sometimes known as RunOnceEx i.e "HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnceEx" which halts until end of execution, then continues to the desktop?

I will add to what has already been suggested that you can use either startup folder that is seen in the start menu on the desktop. You can use the "HKCU\Software\Microsoft\Windows\CurrentVersion\RunOnce" as mentioned above.

Edited by MHz
Link to comment
Share on other sites

I had it in the 'HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce'. And it did hault everything.

I move it to the run 'HKLM\Software\Microsoft\Windows\CurrentVersion\Run' and it works fine

I just need to add a cleanup script to remove it.

Link to comment
Share on other sites

You can use 'HKLM\Software\Microsoft\Windows\CurrentVersion\RunOnce' if suitable. If it is an automated install or other that can not be disturbed by other windows etc, then you could possibly just restart the script so the registry value will clear and continue but your re-spawned script will do its thing.

You could add such as this at the top of your script noting that it expects no /restart switch initially.

If Not $CMDLINE[0] Then
    Run('"' & @AutoItExe & '" /AutoIt3ExecuteScript "' & @ScriptFullPath & '" /restart')
    Exit
EndIf

; your code here to perform

Then there is nothing to cleanup.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...