Create a SendTo (Current Directory Then Delete)

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
nono5551212
Posts: 3
Joined: 25 Jan 2011 12:32

Create a SendTo (Current Directory Then Delete)

#1 Post by nono5551212 » 25 Jan 2011 13:02

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.

ChickenSoup
Posts: 79
Joined: 13 Dec 2010 10:32

Re: Create a SendTo (Current Directory Then Delete)

#2 Post by ChickenSoup » 25 Jan 2011 14:53

Code: Select all

rmdir /S /Q %1


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

aGerman
Expert
Posts: 4678
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Create a SendTo (Current Directory Then Delete)

#3 Post by aGerman » 25 Jan 2011 15:19

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

nono5551212
Posts: 3
Joined: 25 Jan 2011 12:32

Re: Create a SendTo (Current Directory Then Delete)

#4 Post by nono5551212 » 25 Jan 2011 15:32

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

Post Reply