Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
Trolleule

AsynchronousCommand runs on every logon

Recommended Posts

Hi,

i built up a nice answer file and added some AsynchronousCommands. One of these commands does something like:

cmd /K echo "test"

When setup has finished and desktop has loaded a cmd window opens... so far so good. But i noticed, that this fucking command runs on every log on, although the documentation says:

AsynchronousCommand specifies a single command to run the first time that a user logs onto the computer.

I checked the registry and find my defined AsynchronousCommands in

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

but as far as i know, this is a key where one add to run commands on every log on, like Nvidia drivers or makinboards drivers, you know what i mean?

 

Something is really confusing me...

 

I only want to run a command once on logon. Can someone help?

 

Thanks in advance!

Share this post


Link to post
Share on other sites

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

 

This is used to run on every logon just like startup item

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce]

but this is used for run only once on next logon but not every time

 

i never given any command in my answer file i just make a self deletable .cmd file and i use the path of it to run 

Edited by kmaheshkumar

Share this post


Link to post
Share on other sites

I have replicated this using Windows 10 Pro x64 using this XML:

 

<?xml version="1.0" encoding="utf-8"?><unattend xmlns="urn:schemas-microsoft-com:unattend">    <settings pass="windowsPE">        <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">            <SetupUILanguage>                <UILanguage>en-us</UILanguage>            </SetupUILanguage>            <InputLocale>en-us</InputLocale>            <UILanguage>en-us</UILanguage>            <SystemLocale>en-us</SystemLocale>            <UILanguageFallback>en-us</UILanguageFallback>            <UserLocale>en-us</UserLocale>        </component>    </settings>    <settings pass="oobeSystem">		<component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">            <InputLocale>0409:00000409</InputLocale>            <SystemLocale>en-us</SystemLocale>            <UILanguage>en-us</UILanguage>            <UserLocale>en-us</UserLocale>        </component>        <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><LogonCommands>   <AsynchronousCommand wcm:action="add">      <CommandLine>cmd /K echo "test"</CommandLine>      <Description>Description_of_command1</Description>      <Order>1</Order>   </AsynchronousCommand></LogonCommands>        </component>    </settings>    <cpi:offlineImage cpi:source="catalog:d:/sources/install_windows vista business.clg" xmlns:cpi="urn:schemas-microsoft-com:cpi" /></unattend>
Happens using /generalize or not. Writes the contents of CommandLine object to the Run key.

Documentation notes that SynchronousCommand (FirstLogonCommands) now will act like AsynchronousCommnand.

https://msdn.microsoft.com/en-us/library/windows/hardware/dn917933(v=vs.85).aspx

However I tested that and FirstLogonCommand does not write anything into the Run key, and as such does not run on each logon.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...