Valnurat

RunOnce

6 posts in this topic

I only have this in the msgbox.exe

MsgBox(0,"1","Test")

I have added a key to the RunOnce registry and it works.

RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce", "SCCM", "REG_SZ", "%logonserver%\netlogon\msgbox.Exe")

But when I reboot and I login to the computer I expect a msgbox to apear, but it does not.

Why can that be?


Yours sincerely

Kenneth.

Share this post


Link to post
Share on other sites



Did you compile the executable to require admin credentials?

 

Share this post


Link to post
Share on other sites

Programs in RunOnce are run before the user has logged in.  I wrote a small script to delete every instance of index.dat on my C: drive.  I set it to RunOnce.  It could delete all the index.dat files because the user had not logged in yet(even if there is no explict login screen because the user login is automatic with no password.)  What happened in my case is I could see the system wait for all the files to be deleted before I got the desktop.

I guess it is similar to running a program as a service in that there should be no user interface.  RunOnce is most used by installers that clean up no longer needed files during the reboot after an install.

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

5 hours ago, MattHiggs said:

Did you compile the executable to require admin credentials?

 

#include <MsgBoxConstants.au3>

#RequireAdmin

If IsAdmin() Then MsgBox($MB_SYSTEMMODAL, "", "The script is running with admin rights.")

I tried this, but I get no messagebox.

Edited by Valnurat

Yours sincerely

Kenneth.

Share this post


Link to post
Share on other sites
5 hours ago, MilesAhead said:

Programs in RunOnce are run before the user has logged in.  I wrote a small script to delete every instance of index.dat on my C: drive.  I set it to RunOnce.  It could delete all the index.dat files because the user had not logged in yet(even if there is no explict login screen because the user login is automatic with no password.)  What happened in my case is I could see the system wait for all the files to be deleted before I got the desktop.

I guess it is similar to running a program as a service in that there should be no user interface.  RunOnce is most used by installers that clean up no longer needed files during the reboot after an install.

 

How is it possible for me to continue a installation after a reboot?


Yours sincerely

Kenneth.

Share this post


Link to post
Share on other sites

I just learned this by searching now.  There is a program in system32 called runonce.exe.  Evidently it is a wrapper for the RunOnce key that kludges around the login issue.  You might ask on Inno Setup forum as that install maker is pretty open and the author may be willing to discus the nuances of the install spanning booting.

 

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

  • Similar Content

    • Nareshm
      By Nareshm
      I create message box but i dont know how to add button action when i click it.

      Help for : Add script for Button : Left, Right, Right Finger
      example when i press Left finger button do Case $idNotepad
                      $iPID = WinActivate ( " :PS :: Version - 2.8.0.0  - [eFS Bill]")
                              ControlSend(" :DS  - eF :: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:btnReset]", "{esc}")
                              ControlClick ( " :DS  - eF :: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:txtrdNo]")
                              ControlSend(" :DS  - eF:: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:txtrdNo]", "^v")
                              ControlSend(" :DS  - eF :: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:txtrdNo]", "{enter}")
      How to add like above ?
                    
                                                                sorry for my bad english
       
    • nacerbaaziz
      By nacerbaaziz
      Hi friends, I have a question, please.
      I have created a window containing a edit box
      I need to know how to change the keyboard language,
      e.g :
      if a user open the  script  it will be change the keyBord language   in window automatically into English
      I found more examples but didn't work with me .
      Note:  
       I use the windows 10 os
      Please help me .
      thanks in advance to all
      with my Greetings and my appreciation for all users and admins
    • JustinZandee
      By JustinZandee
      I want to create a loop which loops a code until for example f2 is pressed.
      So I tried something with _IsPressed but it doesn't work.
      Local $test = WinActivate("Notepad") Do Send("hi") Until _IsPressed("72", $test)  
      I don't know how I can do nothing when pressing f2 because it says "error: _IsPressed(): undefined function.".
      I did put 
      Send("hi") after Local $test = but it gives the same error.
      Does anyone know how to solve this problem? 
      Maybe I am wrong and I need to use a whole other Function.. I am new to AutoIT so I am sorry..
       
    • JustinZandee
      By JustinZandee
      I need a random string generator which creates 15 letters/numbers.
      How can I make that?
    • KB505
      By KB505
      Hello,
       
      I'm starting a script in AutoIT to automize a task in a software. I need to click a several Controls. 
      I'm just starting to learn AutoIT, and discovered that we can use the Window Info tool (au3info) to identify controls precisely and targetting safely a specific button.
      However, when I try it, I realize that most of the controls in my toolbar have the same Control Info (No ID, same class, same instance, ...). The only thing that changes is the ControlClicks Coord but I don't think that it's interesting, I don't see the difference with the Mouse Coordinates. Besides, I was aiming to write a stable script that would work even if the button changes a little bit of place for example. 
      Should I use another tool that Window Info tool to detect this Controls ? Is there another way to identify a Control ? 
      Thank you in advance for your help