copy command in an unattend file to just copy shortcuts to the desktop


  1. Posts : 4
    WIN 10
       #1

    copy command in an unattend file to just copy shortcuts to the desktop


    Hello All,

    I have created a new image for our laptops that we are deploying out. In this new image I would like to copy two shortcuts to the local administrator's desktop. I have the administrator's account to be set to active under the 4 specialize section of the answer file. The administrator account is also set to auto login. Everything runs as it should when I mage a laptop BUT the commands I have entered to just copy the .lnk files from a folder on the root of C:\ to the Administrator's desktop does not work. I basically copied the command I used at the command prompt to make sure the command works and it does if I run it manually.

    I have created a SynchronousCommand under the 7 oobe System>FirstLogonCommands section with the following command under the Settings>CommandLine field:

    copy "C:\_Install\XImaging\DesktopIcons\_Install Folder.lnk" C:\Users\Administrator\Desktop

    What am I doing wrong??
      My Computer


  2. Posts : 4,187
    Windows 11 Pro, 22H2
       #2

    Are you sure that the user name "Administrator" is correct? During unattended setup you should be creating an administrator account named something other than "Administrator" and it is user name that you should be specifying in the path.
      My Computers


  3. Posts : 16,948
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #3

    Whilst I agree that you should not be using the [Built-In] Administrator account, might you be trying to copy those .lnk files before the [Built-In] Administrator profile has been created [which is also before the folder C:\Users\Administrator has been created]?

    It is the first login that creates the profile & the folder not the creation of the account itself.

    MS has never documented the limitations of the [Built-In] Administrator account and they have varied over time. For all I know, you could be hitting the buffers because of a deliberate limitation but you could only test that by trying the same thing you're doing with a different account.

    Denis
      My Computer


  4. Posts : 4
    WIN 10
    Thread Starter
       #4

    hsehestedt said:
    Are you sure that the user name "Administrator" is correct? During unattended setup you should be creating an administrator account named something other than "Administrator" and it is user name that you should be specifying in the path.
    We do create a support admin account but do use the local admin account mainly. That is why the Administrator account is made active during the unattend script.

    Try3 said:
    Whilst I agree that you should not be using the [Built-In] Administrator account, might you be trying to copy those .lnk files before the [Built-In] Administrator profile has been created [which is also before the folder C:\Users\Administrator has been created]?
    It is the first login that creates the profile & the folder not the creation of the account itself.
    MS has never documented the limitations of the [Built-In] Administrator account and they have varied over time. For all I know, you could be hitting the buffers because of a deliberate limitation but you could only test that by trying the same thing you're doing with a different account.
    Denis
    I'll test it with the other admin account that is created but my main concern is the command the way it is written in the unattend script. Does that look correct? Am I missing any switches or anything? The way I have it written in the unattend script should work, correct?

    copy "C:\_Install\XImaging\DesktopIcons\_Install Folder.lnk" C:\Users\Administrator\Desktop

    Thank you for the replies
      My Computer


  5. Posts : 16,948
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #5

    jcrod73 said:
    ... my main concern is the command the way it is written in the unattend script. Does that look correct? Am I missing any switches or anything? The way I have it written in the unattend script should work, correct?
    copy "C:\_Install\XImaging\DesktopIcons\_Install Folder.lnk" C:\Users\Administrator\Desktop
    Yes, it looks correct as long as the path C:\Users\Administrator\Desktop exists at the time it runs.

    Is there another path that you know for certain exists & for which you have write-access at that stage? If so, you could try to test what's happening by altering the command to
    Code:
    copy "C:\_Install\XImaging\DesktopIcons\_Install Folder.lnk" C:\Users\Administrator\Desktop >F:\CopyResults.txt
    where F:\ might be some external drive for which you already know the drive letter.

    Denis
      My Computer


  6. Posts : 4
    WIN 10
    Thread Starter
       #6

    Try3 said:
    Yes, it looks correct as long as the path C:\Users\Administrator\Desktop exists at the time it runs.

    Is there another path that you know for certain exists & for which you have write-access at that stage? If so, you could try to test what's happening by altering the command to
    Code:
    copy "C:\_Install\XImaging\DesktopIcons\_Install Folder.lnk" C:\Users\Administrator\Desktop >F:\CopyResults.txt
    where F:\ might be some external drive for which you already know the drive letter.

    Denis
    Figured it out. I created a bat file with the copy commands in it. Set the FirstLogonCommand with cmd /c "<path to bat file>". Thank you for the responses.
      My Computer


 

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

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




Windows 10 Forums