Jump to content
Ketarin forum

RD command not working


Bunny
 Share

Recommended Posts

I'm trying to delete a folder after the contents have been moved, but the RD command doesn't delete the folder.

I can create a batch file with the RD command and it works.

 

These are the installion commands.

START "" /B /MIN /WAIT "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\7z.exe" x "{file}" -bd -o"C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa\" -y
CD "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa\blender-*-win64"
RD "C:\Users\User\Desktop\My stuff\Art Tutorials\Art\Blender Dev"
xcopy /y /S /Q *.* "C:\Users\User\Desktop\My stuff\Art Tutorials\Art\Blender Dev\"
rd "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa" /s /q

I've tried start and call to start the batch file when the folder should be deleted and they didn't work.

 

Have I missed something?

Link to comment
Share on other sites

Are you talking about the Blender Dev folder? The /S key is missing.
 
RD /S /Q "{file:directory}\your-folder-name"

 

Syntax
RD pathname
RD /S pathname
RD /S /Q pathname

Key
/S : Delete all files and subfolders in addition to the folder itself. Use this to remove an entire folder tree.
/Q : Quiet - do not display YN confirmation

Link to comment
Share on other sites

Are you talking about the Blender Dev folder? The /S key is missing.

 

RD /S /Q "{file:directory}\your-folder-name"

 

Syntax

RD pathname

RD /S pathname

RD /S /Q pathname

 

Key

/S : Delete all files and subfolders in addition to the folder itself. Use this to remove an entire folder tree.

/Q : Quiet - do not display YN confirmation

It doesn't matter if it's there or not. RD just doesn't work for some reason.

Link to comment
Share on other sites

Well... It definitely won't work without, as the folder is most likely not empty. RD (without /s) only acts on empty folders...

I know that. I tried it with and without it and it made no difference. empty or full it had no effect on the folder. outside of Ketarin RD works like it's supposed to.

Link to comment
Share on other sites

Have you tried running it as successive commands? Use "&&" to proceed to the next command only if the first succeeds, which means the first process has to complete before the second command will run.

 

 

"C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\7zc.exe" x -y "{file}" -bd -o"C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa\" && CD "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa\blender-*-win64" && RD "C:\Users\User\Desktop\My stuff\Art Tutorials\Art\Blender Dev" && xcopy /y /S /Q *.* "C:\Users\User\Desktop\My stuff\Art Tutorials\Art\Blender Dev\" && rd "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa" /s /q
Link to comment
Share on other sites

To locate the problem, please safe the RD command into a batch file and let Ketarin execute the batch instead.

I've tried call and start. call does nothing. start gives a cmd window saying the folder is being used by another process which I assume is Ketarin. The batch file works when started outside of Ketarin.

Any other way to start a batch file from another batch file?

 

 

Have you tried running it as successive commands? Use "&&" to proceed to the next command only if the first succeeds, which means the first process has to complete before the second command will run.

"C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\7zc.exe" x -y "{file}" -bd -o"C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa\" && CD "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa\blender-*-win64" && RD "C:\Users\User\Desktop\My stuff\Art Tutorials\Art\Blender Dev" && xcopy /y /S /Q *.* "C:\Users\User\Desktop\My stuff\Art Tutorials\Art\Blender Dev\" && rd "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa" /s /q

With and without start at the beginning and correcting the 7zc spelling error. it did nothing.

Link to comment
Share on other sites

RD [/s] [/Q] [drive:]path

 

In all the examples you provide, you've put the /S /Q flags 'after' the path which can be just a bit confusing depending on situation.

 

Primarily though, START "" /WAIT can conflict with the /B flag - basically the /WAIT does not fire and so all those commands are being executed without actually waiting for the 7z

"C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\7z.exe" x "{file}" -o"C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa\" -y
CD "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa\blender-*-win64"
RD "C:\Users\User\Desktop\My stuff\Art Tutorials\Art\Blender Dev"
XCOPY /Y /S /Q *.* "C:\Users\User\Desktop\My stuff\Art Tutorials\Art\Blender Dev\"
RD /S /Q "C:\Users\User\Desktop\Utility icons\Ketarin-1.7.0\Apps\Art\aaa"

The above should work fine.

 

Keep in mind that Ketarin doesn't actually fire off a 'batch file', it just sends the command as if you were typing them into the cmd.exe window yourself and pressing enter as necessary.

Link to comment
Share on other sites

  • 4 weeks later...
Guest Rainie

I can confirm that rd command doesn't work when used in "Setup"/"Custom script" tab. After many tries I just made a standalone batch file and used "Start Process" instruction:

cmd.exe /c install.bat {file}

That worked for me.

Of course, the deletion command was "rd %tmpdir% /S /Q" in both attempts.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.