Jump to content

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


Recommended Posts

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
Link to comment
Share on other sites


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
Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 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.

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...