As we deploy machines and getting our master image perfect...  Sysprep likes only one user for our custom "default profile" I'd like to add atleast 1 extra user to the machine after imaging using a batch file and creating the profile automatically(without logging in as that user).  The idea is that once the new user profile has been created, we can push shortcuts and etc to it.  Does that make sense?

So, here's where I'm stuck.  Here's my batch file:

net user /add user1 password
net localgroup administrators user1 /add
net share concfg*C:\/grant:user1,full

*Insert create profile command*

1 Comment   [ - ] Hide Comment


  • Could you tell what OS and architecture you are wanting to add the users to using the unattend.xml and I can give you the short answer? I'm assuming Windows 7 64bit...
Please log in to comment

Community Chosen Answer



I'm not sure why you are using sysprep unless this is either for Windows XP or a System Image.  For Scripted Installations I would recommend using an unattend.xml generated by Windows System Image Manager.  You can add multiple local admin accounts that way. 



Change the lines:

strUser = inputbox("Enter the username for the new admin account.") 
= inputbox("Enter the password for the new account.")


strUser = "Username" 
= "Password"

Where "Username" is the Username and "Password" is the actual Password.  (Yes I know that's obvious but...)

Name it adminuser.vbs and call it from a command line like:

cscript.exe adminuser.vbs

You can upload the script as a Post-Installation Task on the K2000.  No need for a "batch" file to run it then, but you can call the script from a batch.

To protect the user and password in the script, encrypt it with screnc.exe which you can find online.  Make sure to rename it to .vbe though if you do.

Veritas Amor Pax

Answered 09/25/2013 by: crispybiscuit
Orange Belt

  • He didn't include the K2000 tag on the post so assuming he's deploying with the K2000 might not be correct.
  • I just assumed so because the K2000 handles system images while the K1000 handles inventory, patching, and package management mostly. Sometimes you have to put "K1000" or "K2000" in your title to get the tags to show up. At least, that's what works for me. Then I remove them from the title if I want. If anyone has a better way of getting tags to show up please tell me! Thanks!
Please log in to comment
Answer this question or Comment on this question for clarity



I don't believe there is a way to create a user's profile without having the user login to the computer. 

Answered 09/26/2013 by: chucksteel
Red Belt

  • Thanks for the feedback. Your right Chucksteel, I want to use this batch/script with the K1000 box if at all possible. But the possibility of adding the user on the deployment side intrigues me... What do I need to add to my unattend.xml file to make "User2"? I'm poking around the Win System Image Manager and probably overlooking the Components...
    • To add an account with the unattend look in Microsoft-Windows-Shell-Setup, User Accounts, Local Accounts.
      • Go with this jb! You can add DomainAccounts like groups as well. Thanks Chuck! That's the short of it. Been wanting to respond but that whole work business got in the way.

        All of this is under "oobeSystem" I believe.
  • You can create the profile with the script above, but if you want the actual user folder and files to appear they will have to log on. You can easily create a script in "Scripting" of the K1000 to create this profile on all machines. I was planning on making a blog post today similar to your request. It's a script to change the admin password of all machines using the Scripting feature of the K1000. It's use is for when someone unfortunately leaves employment and the password has to be changed. I also have it set to a schedule just in case anyone gets sneaky or sloppy.

    Give me a second and I'll post the how to on adding users with the unattend.xml file. Shoot I may make that a blog post as well as you can use it to add domain groups to the local admin group and therefore have all your techs in that domain group and they will be local admins with their own logins everywhere they go. Need some caffeine first.
Please log in to comment

You can't create a profile via cmd line (i think??), the best you can do is auto logon for that profile, then logout/reboot or what ever.

Have a look at this link below, it will create a auto logon on next reboot, set the AutoLogonCount:1 (note the REG_DWORD, other websites say REG_SZ which is WRONG). When AutoLogonCount hits zero will remove the password etc - check though!

After you auto logon I would suggest adding something to RunOnce reg key:
-like to run a batch file to wait 2mins (chance to for the profile to sort it self out),
-then a cmd to log off or reboot. If your worried about security you can also send a lock
-workstation in the batch file (rundll32.exe user32.dll,LockWorkStation)
Run Once: HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

Good luck.

Answered 09/26/2013 by: rileyz
Red Belt

  • Yeppers! You could make a script to do this and auto reboot the computer as well and send it out through the K1000. This procedure would create the profile files if needed in answer to ChuckSteel above.
Please log in to comment

If you have pstools to can remotely log into the computer with it and that will create the profile.

Answered 09/26/2013 by: SMal.tmcc
Red Belt

  • Certain classrooms need a local user and we need to put a special link on the desktop for new student orientation. We use the k1000 to create the user with net use command and then use psexec running a txt list of the machines and that creates the profile in the background and the psexec command copies the link for us without ever touching the machines.
    • Sounds interesting. Care to share?
      • We run this from a server vs w/s so certain staff can remote to server and run and we only have one set of files out there.

        We have a text files for the the classrooms with the machines names in them

        example red-121.txt would look like:


        then using pstools psexec we call that text file and a batch file to do the task. The user you name in the psexec get passed to the machines and if that profile does not exist it does a remote login and the profile gets created.

        the call would be
        psexec @red-121.txt -i -accpteula -u (user or domain\user) -p password -d fixicon.bat

        you should be able to upload psexec and the batch file as dependencies and then call that via a k1000 script even
Please log in to comment


I don't know when I'll have time to type up a blog about all the cool things you can do with the unattend.xml, but I want to give you something that you can pick apart.  I've removed all my employer's info of course so hunt through and enter your info.  If you need this for 32 bit, just replace:




Well, at least I think that will work.  Haven't tested it.  Just didn't have time to edit out the info on the 32bit version I created.

Here's the xml:

<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <settings pass="windowsPE">
    <component name="Microsoft-Windows-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
    <component name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
  <settings pass="specialize">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <TimeZone>Central Standard Time</TimeZone>
    <component name="Microsoft-Windows-UnattendedJoin" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
    <component name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
        <RunSynchronousCommand wcm:action="add">
          <Path>reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v Category /t REG_DWORD /d 00000001 /f</Path>
          <Description>Setting Network Location</Description>
        <RunSynchronousCommand wcm:action="add">
          <Path>net user administrator /active:yes</Path>
          <Description>Enable Default Admin</Description>
        <RunSynchronousCommand wcm:action="add">
          <Description>Setting Network Name</Description>
          <Path>reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v NetworkName /t REG_SZ /d "Work" /f</Path>
        <RunSynchronousCommand wcm:action="add">
          <Description>Setting Network Icon</Description>
          <Path>reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\NetworkList\Signatures\FirstNetwork" /v IconPath /t REG_SZ /d "%WINDIR%\system32\NetworkList\Icons\StockIcons\Office" /f</Path>
        <RunSynchronousCommand wcm:action="add">
          <Description>Setting Power Plan</Description>
          <Path>POWERCFG -SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c</Path>
        <RunSynchronousCommand wcm:action="add">
          <Description>Setting Monitor Timeout</Description>
          <Path>POWERCFG -X -monitor-timeout-ac 0</Path>
        <RunSynchronousCommand wcm:action="add">
          <Description>Setting Disk Timeout</Description>
          <Path>POWERCFG -X -disk-timeout-ac 0</Path>
        <RunSynchronousCommand wcm:action="add">
          <Description>Setting Standby Timeout</Description>
          <Path>POWERCFG -X -standby-timeout-ac 0</Path>
        <RunSynchronousCommand wcm:action="add">
          <Description>Setting Hibernate Timeout</Description>
          <Path>POWERCFG -X -hibernate-timeout-ac 0</Path>
        <RunSynchronousCommand wcm:action="add">
          <Description>Setting Hibernate to Disabled</Description>
          <Path>POWERCFG -H OFF</Path>
        <RunSynchronousCommand wcm:action="add">
          <Description>Setting RemoteRegistry to Auto</Description>
          <Path>sc config RemoteRegistry start= auto</Path>
        <RunSynchronousCommand wcm:action="add">
          <Description>Setting FireWall to disabled</Description>
          <Path>netsh advfirewall set privateprofile state off</Path>
        <RunSynchronousCommand wcm:action="add">
          <Description>Setting NIC Auto Power Off to Never</Description>
          <Path>reg add "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0007" /v PnPCapabilities /t REG_DWORD /d "280" /f</Path>
        <RunSynchronousCommand wcm:action="add">
          <Path>reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" /v SoftwareSASGeneration /t REG_DWORD /d "3" /f</Path>
          <Description>Enable SAS for Bomgar</Description>
    <component name="Microsoft-Windows-IE-InternetExplorer" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
        <Scope wcm:action="add">
  <settings pass="oobeSystem">
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
          <LocalAccount wcm:action="add">
            <Description>Local Administrator</Description>
          <DomainAccountList wcm:action="add">
            <DomainAccount wcm:action="add">
    <component name="Microsoft-Windows-International-Core" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
  <settings pass="generalize">
    <component name="Microsoft-Windows-Security-SPP" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
    <component name="Microsoft-Windows-PnpSysprep" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
  <settings pass="offlineServicing">
    <component name="Microsoft-Windows-LUA-Settings" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
  <cpi:offlineImage xmlns:cpi="urn:schemas-microsoft-com:cpi" cpi:source="wim:d:/win7ent/sources/install.wim#Windows 7 ENTERPRISE"/>

Just pick through it and see if you find anything you like.  Look at the RunSynchronousCommand's.  There's some goodness there!

Bonne chance!

Answered 09/26/2013 by: crispybiscuit
Orange Belt

Please log in to comment