Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How do I run a command AFTER booting to the desktop as Administrator?

Featured Replies

Ok, so I gave up on FirstLogonCommands because running setupcomplete.cmd in \scripts does the same thing.

However what I really need to finalize my unattended setup is to be able to launch an app installer AFTER the computer autologin's as administrator to the desktop. How can I do this?

Edited by fragbert

  • Author
self deleting file in startup folder would be one option.

The only option?

Would runonceex still work?

Yes it will !

That's the way I do it tho ;)

In your xml:

<FirstLogonCommands>

<SynchronousCommand wcm:action="add">

<Order>1</Order>

<CommandLine>c:\install\cmd\end.cmd</CommandLine>

</SynchronousCommand>

</FirstLogonCommands>

end.cmd

@ECHO OFF

%windir%\system32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

%windir%\system32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v "Preload" /t REG_SZ /d "c:\install.cmd" /f

start %systemdrive%\install\Vista.exe

EXIT

Haven't give me any problem for some months now :)

[Edit] Noticed you want to use RunOnceEx where I use RunOnce, guess it won't give you any problems but I'm not 100% sure .. :)

Edited by OcTroN

  • Author
Yes it will !

That's the way I do it tho ;)

In your xml:

<FirstLogonCommands>

<SynchronousCommand wcm:action="add">

<Order>1</Order>

<CommandLine>c:\install\cmd\end.cmd</CommandLine>

</SynchronousCommand>

</FirstLogonCommands>

end.cmd

@ECHO OFF

%windir%\system32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

%windir%\system32\reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /v "Preload" /t REG_SZ /d "c:\install.cmd" /f

start %systemdrive%\install\Vista.exe

EXIT

Haven't give me any problem for some months now :)

[Edit] Noticed you want to use RunOnceEx where I use RunOnce, guess it won't give you any problems but I'm not 100% sure .. :)

OK this is still not what I want - but getting closer. :)

This will launch a process after the "black screen" no-mans-land phase where SetupComplete.cmd executes - but still launches before the desktop is created for the first time.

I have a VERY stingy app that will only install properly AFTER the initial desktop creation is complete and are logged in as Administrator.

So, I tried copying a cmd that launches the install from the startup folder as suggested above - the cmd wont copy to the administrator startup folder!?!? Access is denied? What gives? I even copied that cmd to the mounted WIM and saved and it never showed up. What is so ungodly hard about setting up an unattened Vista install that ends with launching an app install via the administrator startup folder?

Ah I see. Maybe you can try some unofficial way like I do:

start %systemdrive%\install\Vista.exe is a one line AutoIt script that waits for the Introductionscreen to popup, after that it gives a shutdown -r -t 0 command. I don't remember why I made it this way (some years ago now) but it is needed in my installs tho.

If no one is posting a official Microsoft solution you might want to try that, offcourse the shutdown thing has to be changed to start your .cmd

Let's hope someone has the knowledge to post a official solution haha ;)

Edited by OcTroN

  • 2 weeks later...

Try googling Elevation PowerToys for Windows Vista, it contains two files, which are elevate.cmd and elevate.vbs, then place them under $OEM$\$$\System32, after that,add an entry into FirstLogonCommands

REG ADD HKLM\Software\Microsoft\Windows\CurrentVersion\Run /v desktoprun /d "elevate.cmd %CDROM%\blah.exe" /f

That's what i do.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.