Schedule task to run when a new profile is created using Win 7


  1. Posts : 6
    Winodw 7 Pro 64-bit
       #1

    Schedule task to run when a new profile is created using Win 7


    I need to replace a RunOnce procedure from XP. Using it with Win 7 is interrupted with UAC prompts which is an unacceptable option and disabling UAC within our environment is not an option. I am attempted to replace the process with Task Scheduler. However, I only want this to run when a new user logs on to the PC. I am open to other suggestions if this can’t be accomplished through Task Scheduler, but the solution can only run when a new profile is created.
      My Computer


  2. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #2

    Hi jennnnnnn and welcome W7 Forums

    What is the function of this procedure?
      My Computer


  3. Posts : 6
    Winodw 7 Pro 64-bit
    Thread Starter
       #3

    What the original RunOnce accomplished.


    Originally the RunOnce from the default profile was used to launch a local VBS which ran three batch files which edited the registry when a new profile is created.
      My Computer


  4. Posts : 9,582
    Windows 8.1 Pro RTM x64
       #4

    What specific changes did the routine make to the registry?
      My Computer


  5. Posts : 6
    Winodw 7 Pro 64-bit
    Thread Starter
       #5

    A new key is added to HKEY_Current_User\Software and then three more are added to that key. If you need more info let me know.
      My Computer


  6. Posts : 6
    Winodw 7 Pro 64-bit
    Thread Starter
       #6

    I can get Schedule Task to launch my task when a new profile is created from a batch file in the Runonce of the default profile. However I am still getting a UAC prompt due to the registry writing. I have the task set up to run using a System account but I still get prompted. Any suggestions?
      My Computer


  7. Posts : 6
    Winodw 7 Pro 64-bit
    Thread Starter
       #7

    Schedule Tasks still gives UAC


    According to this website Schtasks - Scheduled tasks | SS64.com I should be able to create or run a task and use /RU to use a system account. The site says "For the system account, /RU username can be written as "", "NT AUTHORITY\SYSTEM" or "SYSTEM", a Password is not required. The system account has full access to the local machine", yet I always get prompted for UAC approval. It doesn't ask for credentials, but I do have to repond to the prompts. Any assistance will be appreciated. The task writes a key to HKEY_CURRENT_USER when a new profile is created via a RunOnce batch file.
      My Computer


  8. Posts : 72,037
    64-bit Windows 11 Pro for Workstations
       #8

    Hello Jen, and welcome to Seven Forums.

    You may be able to use either tutorial below to create an elevated shortcut with, then run the shortcut in the RunOnce registry entry.
    Hope this helps, :)
    Shawn
      My Computer


  9. Posts : 6
    Winodw 7 Pro 64-bit
    Thread Starter
       #9

    I am trying to use the above recommendation but I need the shortcut to run using a system account. Here is the part I need assistance with. "runas /user:Brink-PC\Administrator /savecred " Below is the entire line.

    runas /user:Brink-PC\Administrator /savecred "C:\Program Files\CCleaner\CCleaner.exe"
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:48.
Find Us