Page 1 of 1

Create a SendTo (Current Directory Then Delete)

Posted: 25 Jan 2011 13:02
by nono5551212
I need a batch file that I can execute from the right click sendto option that will.

When I right click a folder and select sendto I want it to activate this command on that folder

Code: Select all

rmdir /S /Q 


Your probably thinking why not just hit delete..
Well on Vista, 7, & Server 2008 when I select the delete option from a share on my AS400 it will not delete sub folders
So I need to create a batch file to run the command above.

When I right click a folder and sendto the below code will open cmd with the path of the folder right clicked

Code: Select all

@echo off
cmd.exe /k pushd %1
Exit


In a nut shell I need a batch file to run this command on the right clicked folder. Please Help

Code: Select all

rmdir /S /Q 


To add a batch file to your send to... from the run command type sendto and place your batch in that folder. now when you right click a folder and select sendto you will see your batch.

Re: Create a SendTo (Current Directory Then Delete)

Posted: 25 Jan 2011 14:53
by ChickenSoup

Code: Select all

rmdir /S /Q %1


Copy to:
C:\Documents and Settings\UserName\SendTo\Remove.bat

Re: Create a SendTo (Current Directory Then Delete)

Posted: 25 Jan 2011 15:19
by aGerman
Not sure, but you could create this batch file in the "SendTo" folder.

Eraser.bat

Code: Select all

@echo off &for %%i in (%*) do (echo %%~ai|find "d" >nul &&rd /s /q "%%~i" ||del "%%~i")

This should work for folders and files as well.

Use on your own risk. I didn't test it enough...

Regards
aGerman

Re: Create a SendTo (Current Directory Then Delete)

Posted: 25 Jan 2011 15:32
by nono5551212
Thanks that worked but now I hit the F5 key to refresh the explorer tree..

Code: Select all

rmdir /S /Q %1

Do you know a command that will refresh simulate pressing the F5 key