Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help $OEM$
#3
for me, I use follow script in unattend.xml file. this can copy a folder in USB disk to the C dirve. and then, set a command to run the file in this folder after the new system boot up.

content in unattend.xml

Code:
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-Deployment" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<RunSynchronous>
<RunSynchronousCommand wcm:action="add">
<Order>1</Order>
<Path>cmd /q /c "FOR %i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %i:\Drivers\StartCopy.CMD cmd /k %i:\Drivers\StartCopy.CMD"</Path>
</RunSynchronousCommand>
</RunSynchronous>
</component>


content in startcopy.cmd

Code:
@echo off

if exist %systemroot%\Drivers\start.bat exit

:: set USB and location Dir
set USB=%~d0
set FILEDIR=%USB%\Drivers\ShouldBeCopied
set DESTDIR=%systemdrive%\Drivers\

echo "Copy started\r\n"

xcopy /herky %FILEDIR%\*.* %DESTDIR%\

exit
Reply


Messages In This Thread
Help $OEM$ - by Cyberfox - 05-10-2022, 02:12 PM
RE: Help $OEM$ - by ToysILike - 09-25-2025, 10:19 PM
RE: Help $OEM$ - by venster - 10-04-2025, 03:18 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)