1

Suppose I'm working in a system that wants to execute something in a workflow step, but I want it to do nothing instead.

Unlike the slightly-related question Dummy command in windows cmd, I'm not in any sort of shell (that I'm aware of). I can only point to an executable and provide parameters.

Is there anything in a typical Windows installation that can be executed as a do-nothing placeholder and returns 0 as its exit code?

I could install a dummy script, but I'd rather avoid doing that to maintain some portability.

aaaantoine
  • 900
  • 8
  • 19

1 Answers1

2
C:\Windows\System32\cmd.exe /D /C ""

If there's no shell, then %SYSTEMROOT% is likely not available. For a typical, out-of-the-box installation, the above path is expected. Otherwise, customize to fit your environment.

From the help text:

/C      Carries out the command specified by string and then terminates
. . .
/D      Disable execution of AutoRun commands from registry (see below)

Following up /C with "" executes nothing. Invoking /D prevents any default scripts from running.

Finally, this returns 0, so it won't interrupt the workflow.

aaaantoine
  • 900
  • 8
  • 19