Hi guys im currently working in a school and Ive created a script to scan all student folders for sepcific file types, I was wondering if there was a way I could have it make a copy of the specific file type before deleting it? I couldnt think of a way to do it as both xcopy and robocopy require a source address within the syntax. Here is my script
@echo off
net use X: \\LOCATION FOR STUDENT FOLDERS
net use Y: \\LOCATION FOR COPIED FILES
net use Z: \\LOCATION FOR .TXT FILE OF DELETED FILES
X:
cls
Echo Deleting bat files please wait...
del /s *.bat > Z:\DeletedFiles.txt 2>&1
Echo Deleting CMD files please wait...
del /s *.cmd >> Z:\DeletedFiles.txt 2>&1
Echo Deleting VBS files please wait...
del /s *.vbs >> Z:\DeletedFiles.txt 2>&1
Echo Deleting Executable files please wait...
del /s *.exe >> Z:\DeletedFiles.txt 2>&1
mountvol X:\ /D
mountvol Y:\ /D
mountvol Z:\ /D
cls
Echo Process Completed. Drives Unmounted
set /p=Press Any Key To Close
Im assuming it isnt as easy (let alone even possible) as entering in something like below?
xcopy *.bat Y:\
By the way powershell scripts arent at my disposal as I dont have rights to run them (silly education department) but if there is a powershell alternative please post that too as it would be good for me to learn.