Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

Batch Command Delete All Files and Subfolders #2902

ronniechew ·
I'm trying to use DOS command RD or RMDIR to delete files and folders.
It works when I use the command directly in command prompt, but when I call the same command from QuickBuild > Shell/Batch Command, it always return this error:

Cannot run program "rmdir" (in directory "C:\quickbuild-5.0.10\workspace\root\Release_trunk\Build\PackageTemp"): CreateProcess error=2, The system cannot find the file specified

It seems QuickBuild failed to understand "RMDIR" as a built-in command for "CMD.exe" and looking for "RMDIR.exe" instead.

How do I resolve this?
  • replies 5
  • views 3157
  • stars 0
Maxxi ·
Are you sure you you used the "Shell/Batch Command" step?

This for example works fine for me, and it uses "mkdir":

if not exist ${build.version} mkdir ${build.version}

Maybe try adding a slash to the end of your path so it knows it's a directory, I had that problem sometimes.
It may also just be that your directory does not exist. "C:\quickbuild-5.0.10\workspace\root\Release_trunk\Build\PackageTemp"
robinshen ADMIN ·
Make sure you upgrade to QB 5.1, otherwise you will have to prefix your command with "cmd /c ".
ronniechew ·
Yes, the /C switch for cmd.exe works. Thanks.
Siddarth_Murthy ·
Hi,

We are on QB 4.0.28 and we are running the below command to delete a directory using the shell/batch command build step.

But we are receiving the below error. Can you please help on how to set this command to delete the directory.

rmdir /C E:\TSCM\workspace\Docs

Cannot run program "rmdir" (in directory "E:\TSCM\workspace\Docs"): CreateProcess error=2, The system cannot find the file specified
robinshen ADMIN ·
Try below instead:

cmd /c rmdir /C E:\TSCM\workspace\Docs