Windows uses Services for background tasks with no shell, but they have to be specially coded - you can't just run any command as a service. The closest you'd get would maybe be the start command, which starts a new shell. Yes, that's correct.
So it's not suitable for long-running remote background jobs. Superuser has the answer , paddy. Add a comment. Active Oldest Votes. Oeste Oeste 2 2 gold badges 6 6 silver badges 13 13 bronze badges. See this answer: stackoverflow. I would test it myself, but I'm not near a windows computer right now. Just as a confirmation: yes, the command WILL DIE if you log off if you connected on the windows machine from a telnet to run the command.
On windows there are a number of options for what you are looking for: Best: write your program as a windows service. CreateObject "WScript. Shell" objShell. Worst: Start the command using the startup folder. This runs when a user logs into the computer Hope that helps some! Community Bot 1 1 1 silver badge. Save the VB Script with the extension ". Josh Withee Josh Withee 7, 3 3 gold badges 31 31 silver badges 51 51 bronze badges. Linq; using System.
Diagnostics; using System. Join " ", args. Skip 1. GetDirectoryName command ; p. Afterparty Afterparty 31 1 1 bronze badge. Sign up or log in Sign up using Google. The answer there describes how to run a batch file window hidden: You could run it silently using a Windows Script file instead. Shell" WinScriptHost. Improve this answer. Tobias Kienzler 4, 7 7 gold badges 40 40 silver badges 74 74 bronze badges.
This is perfect. 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. It really isn't vague if you are used to linux.
B Start application without creating a new window. Novicaine Novicaine 3, 2 2 gold badges 10 10 silver badges 2 2 bronze badges. I like this answer best because it doesn't open another command window — wisbucky. This doesn't seem to work for me, it seems to only create a new cmd instance [? For some reason with Windows 7, this is the command format. The "" is the mandatory title parameter.
Unfortunately, if I exit the shell window in which I spawned the process, it looks like the process also terminates. Show 6 more comments. Paul Douglas Paul Douglas 6 6 silver badges 3 3 bronze badges. Can we close the command prompt and the porgram will still run? 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. 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.
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? Show 3 more comments. Siva Sankaran Siva Sankaran 2 2 silver badges 8 8 bronze badges. You can use this commented! PowerShell script: Create the. Ben N Ben N Install the subsystem for unix to get the bash or ksh prompt and execute it from there if you want job control however it would not suprise me if running it as a background job causes issues.
You will probably want to run it as a background process instead. For Windows, I found this post about some equivalents.. There is no equivalent. You could install cygwin and do the same thing. Or you could make a service that runs your application : srvany or other tools will do this for you. Keep in mind that not all Windows applications will properly run in these ways.
You can use HStart for this purpose, it allow to run a command in background. Sign up to join this community. The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group.
Create a free Team What is Teams? Learn more. Tools to run a background process command line in windows? Ask Question. Asked 11 years, 10 months ago. Active 6 years, 5 months ago.
Viewed 30k times. What for windows? Improve this question.
0コメント