This code is from the classic shell help document
Quote:
3) Copy selected files to the parent folder
Create a batch file called C:\CopyParent.bat:
set list=%1
set list=%list:"=%
for /F "delims=" %%i in (%list%) do copy /Y "%%i" ..
del %1
Use this command: C:\CopyParent.bat "%3". %3 will be replaced by a text file containing the full names of all selected files. The batch file will read each line of that text file, and copy each of the selected files to the parent folder. At the end the batch file deletes the initial temp file. The first two set commands remove the quotes from the %1 parameter.This is a modification of the above script, Though I suspect you want a single button to toggle the hidden state (which I have been unable to figure out thusfar, and maybe someone else can help with formatting the IF statement)
this will hide the selected files
@echo on
set list=%1
set list=%list:"=%
for /F "delims=" %%i in (%list%) do attrib +H "%%i"
del %1
this will un-hide the selected files
@echo on
set list=%1
set list=%list:"=%
for /F "delims=" %%i in (%list%) do attrib -H "%%i"
del %1