Is there a Windows exe that does nothing?

You may use rundll32:

  • No console window
  • No side effects
  • Just 44 KB
  • No arguments required
  • Works on every recent Windows version (XP, Vista, 7), and probably on every NT-based system.

Is there a "noop"-esque exe somewhere as part of the Windows installation?

Meaning specifically a program that is meant to do nothing and nothing else? Yes and no. No in that Windows does not include one by default, but it does include the ability to make one yourself.


Option 1

Run notepad.exe, type the following lines, and save it as C:\ret.scr (don’t forget the blank line):

a
ret

rcx
1
n ret.com
w
q

Compile it with debug.exe at the command-prompt (cmd.exe) with following command:

C:\> debug < ret.scr

You now have a program, ret.com (in C:\) that can be used in batch files which does absolutely nothing whatsoever (well, other than quit, if that counts).

Note: debug is not included on 64-bit systems.


Option 2

In Vista and up, the .NET framework is included by default, so you could also make a native, Windows do-nothing .exe with C# (64-bit compatible):

Run notepad.exe and type the following lines, saving it as C:\ret.cs:

class rte
{
   static void Main() {
   }
}

Compile it with csc.exe at the command-prompt (cmd.exe) with the following command:

C:\> csc ret.cs

You now have another program, ret.exe (in C:\) that can be used in batch files which does nothing but return.


There aren't any programs included with Windows (that I know of) which immediately exit when executed (at least on purpose.)

In Windows Vista and newer, however, there is the timeout.exe utility. Timeout.exe will wait a specified number of seconds and then exit. For example:

C:\>timeout /t 0 > nul:

Setting timeout.exe to wait for 0 seconds is about as close as a you'll get to an EXE that immediately exits.

Tags:

Windows