Jump to content
Sign in to follow this  
kubie

After reboot desktop doesnt open when autoIT is in RunOnce

Recommended Posts

kubie

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

Share this post


Link to post
Share on other sites
Jos

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
MHz

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

Share this post


Link to post
Share on other sites
kubie

Yup. That was it.

Thanks for the prompt responce.

Share this post


Link to post
Share on other sites
kubie

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.

Share this post


Link to post
Share on other sites
MHz

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.

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.