Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I execute a windows command line in the background, without it interacting with the active user?

share|improve this question
Can you specify what you want to do? Do you want to perform a command on the command line in background or do you want to perform the whole command line in background, so it is unvisible from the desktop? – omnibrain Oct 12 '10 at 6:20
i need two cane perform a command on the command line in background or do you want to perform the whole command line in background – Mohammad AL-Rawabdeh Oct 12 '10 at 6:41
Duplicates this question on ServerFault. – Dan Dascalescu Aug 16 '15 at 20:11
up vote 12 down vote accepted

Your question is pretty vague, but there is a post on ServerFault which may contain the information you need. The answer there describes how to run a batch file window hidden:

You could run it silently using a Windows Script file instead. The Run Method allows you running a script in invisible mode. Create a .vbs file like this one

Dim WinScriptHost
Set WinScriptHost = CreateObject("WScript.Shell")
WinScriptHost.Run Chr(34) & "C:\Scheduled Jobs\mybat.bat" & Chr(34), 0
Set WinScriptHost = Nothing

and schedule it. The second argument in this example sets the window style. 0 means "hide the window."

share|improve this answer
This is perfect. SetPoint for Logitech never, NEVER, starts with windows. I've been starting it manually for about 3 years now. Does it matter where the batch is? I've seen some people put this type of batch file in C, or the root. – ejbytes Jan 31 at 0:00

This is a little late but I just ran across this question while searching for the answer myself and I found this:

START /B program

which, on Windows, is the closest to the Linux command:

program &

From the console HELP system:


Starts a separate window to run a specified program or command.

START ["title"] [/D path] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
      [/NODE <NUMA node>] [/AFFINITY <hex affinity mask>] [/WAIT] [/B]
      [command/program] [parameters]

    "title"     Title to display in window title bar.
    path        Starting directory.
    B           Start application without creating a new window. The
                application has ^C handling ignored. Unless the application
                enables ^C processing, ^Break is the only way to interrupt
                the application.

One problem I saw with it is that you have more than one program writing to the console window, it gets a little confusing and jumbled.

To make it not interact with the user, you can redirect the output to a file:

START /B program > somefile.txt
share|improve this answer
I like this answer best because it doesn't open another command window – wisbucky Jan 3 '14 at 16:17
This doesn't seem to work for me, it seems to only create a new cmd instance [?] however if I run it like start /B "" program then it worked... – rogerdpack Jun 24 '15 at 4:56
@rogerdpack That's right. For some reason with Windows 7, this is the command format. The "" is the mandatory title parameter. – ejbytes Jan 30 at 23:58
@ejbytes I run Windows 7 and I don't need the empty parameter "" in order for it to work. – HelloGoodbye Apr 13 at 15:26
@Novicaine: How do I abort a process I have started that way? Ctrl+c doesn't have any effect on in. – HelloGoodbye Apr 13 at 15:28

I suspect you mean: Run something in the background and get the command line back immediately with the launched program continuing.

START "" program

Which is the Unix equivalent of

program &
share|improve this answer
what is the fg equivalent? Can we close the command prompt and the porgram will still run? – Nenotlep Oct 15 '14 at 11:34
Also, I want to run a program in command prompt and return to it from time to time, like in screen - is that doable with this? I need to be able to close the command prompt but keep the running program usable. – Nenotlep Oct 15 '14 at 11:36
What's that empty parameter of start? It doesn't work without it (executes just a new command instance), but start's help doesn't say anything about it, it states all parameters are optinional (or I don't understand it). – Dawid Ferenczy Oct 14 '15 at 17:41
@DawidFerenczy start works without the empty parameter for me, but I seem to get a shells with a separate configuration when I use the empty parameter, as a setting I did when I didn't have the empty parameter isn't used when I do use the empty parameter. I wonder why they use separate configurations? – HelloGoodbye Apr 13 at 15:23
@Paul START "" program starts a command in a new terminal for me, while program & in Unix runs the command in and prints the output to the same terminal. – HelloGoodbye Apr 13 at 15:25
START /MIN program 

the above one is pretty closer with its Unix counterpart program &

share|improve this answer

If you want the command-line program to run without the user even knowing about it, define it as a Windows Service and it will run on a schedule.

share|improve this answer
how do you do that? – barlop Sep 30 '11 at 19:26
Alternatively you can make it a scheduled task - Control Panel->Administrative Tools->Scheduled Tasks or use the schtasks command in Windows XP and above (warning: schtasks is complicated). – LawrenceC Apr 6 '12 at 19:02

An example :

start /MIN /B grep -noid include *.c 1>log.txt 2>1&

Starts grep in backgound redirect both stdout && stderr to log.txt

share|improve this answer
This answer has already been given multiple times and was explained in great detail. Does your answer contribute anything that has not yet been said? – Michael K Jan 28 '14 at 14:33
@echo off&color 4a&title %~n0&AT>NUL                                                                 
IF %ERRORLEVEL% EQU 0 (                                                                            
    goto 2                                                                                           
) ELSE (                                                                                            
if not "%minimized%"=="" goto 1                                                             
set minimized=true & start /min cmd /C "%~dpnx0" & cls & exit                                   
wmic process where name="cmd.exe" CALL setpriority "realtime">nul                         
echo set shell=CreateObject("Shell.Application") > %~n0.vbs                                 
echo shell.ShellExecute "%~dpnx0",,"%CD%", "runas", 1 >> %~n0.vbs                                  
echo set shell=nothing >> %~n0.vbs&start %~n0.vbs /realtime                                      
timeout 1 /NOBREAK>nul& del /Q %~n0.vbs&cls&exit                                                  
echo %~dpnx0 frackin admin mode look up&wmic process where name="cmd.exe" CALL setpriority "realtime"&timeout 3 /NOBREAK>nul
echo x=msgbox("end of line" ,48, "%~n0") > %~n0.vbs&start %~n0.vbs /realtime
timeout 1 /NOBREAK>nul& del /Q %~n0.vbs&cls&exit
share|improve this answer
needs further editing i like grouping commands cls&echo hi&pause&ect – strange Oct 9 '14 at 2:49
Include in your answer an explanation of what the code does. – Kevin Panko Oct 9 '14 at 3:18

just came across this thread windows 7 , using power shell, runs executable's in the background , exact same as unix filename &

example: start -NoNewWindow filename

help start

NAME Start-Process

SYNTAX Start-Process [-FilePath] [[-ArgumentList] ] [-Credential ] [-WorkingDirectory ] [-LoadUserProfile] [-NoNewWindow] [-PassThru] [-RedirectStandardError ] [-RedirectStandardInput ] [-RedirectStandardOutput ] [-Wait] [-WindowStyle {Normal | Hidden | Minimized | Maximized}] [-UseNewEnvironment] []

Start-Process [-FilePath] <string> [[-ArgumentList] <string[]>] [-WorkingDirectory <string>] [-PassThru] [-Verb
<string>] [-Wait] [-WindowStyle <ProcessWindowStyle> {Normal | Hidden | Minimized | Maximized}]

ALIASES saps start

share|improve this answer

You can see the correct way to do this in this link:

How to Run a Scheduled Task Without a Command Window Appearing

Summarizing, you have to checkbox for 'Run whether user is logged on or not'. Task user credentials should be enter after pressing 'Ok'.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.