I create a directory using MD. Once you plug in the USB drive, you select it and it create the directory to the drive, however i am trying to copy files from the source to the new directory on usb. I have tried so many things but nothing seems to work. Here is the .bat file
@echo OFF
diskpart
set source=C:\Users\Public\Documents
set DESTINATION= %computername% %DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%-%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2%/
@echo DESTINATION =%DESTINATION%
:: Create new directory
md "%1\%DESTINATION%"
xcopy %source% %DESTINATION% /y
It creates the directory but it doesnt copy the files from the source to the newly created directory. How can i do that? How do you pass an argument? This the first time i am writting a script. THanks!