How can I copy a file to the users desktop?
AutoRun Wizard does not copy files itself, but you can autorun a small batch file that does.
Create the batch file
- Open Notepad and paste this, changing
Brochure.pdfto your file name:@echo off for /f "usebackq delims=" %%D in (`powershell -NoProfile -Command "[Environment]::GetFolderPath('Desktop')"`) do set "DESK=%%D" copy /Y "%~dp0Brochure.pdf" "%DESK%\" - Choose File > Save as, set "Save as type" to All files, and name it
copyfile.bat(make sure it does not end in .txt). - Put the batch file and your file in the Base Folder, and add the batch file as one of your autorun files.
Why it is written this way
%~dp0is the folder the batch file runs from (the root of your disc), so it works whatever drive letter the disc gets.- Many Windows 10 and 11 PCs keep the Desktop in OneDrive, so
%USERPROFILE%\Desktopis not always the real desktop. Asking Windows for the Desktop folder (the PowerShell line) always finds the right one.
Copying files onto someone's PC should be something they expect. Tell users on your splash screen or menu what the disc will do, and consider letting them choose instead, for example with a link on your HTML menu that opens or downloads the file.
To add a desktop shortcut instead of a copy, see copying a shortcut to the desktop.
Try it yourself. My AutoRun is free to download and fully functional - see how it handles this on your own USB drive or CD.
Download & Try Free