I'm trying to create a batch script or scheduled task that can run this:
pythonw manage.py runserver >nul
This will run if I wrote it from a command prompt, and return me the prompt, but if I try to run it using a batch file or an scheduled task it will open a window and lock itself in that command. The window I will close adding a final "exit" but it will be locked in the first command unless I kill the process in the task manager.
How can I do this? if it works in the normal cmd why don't work the same way when in a .bat or .cmd file?
>nulis meaningless. However your specific problem is something else - in a batch CMD waits for GUI programs to exit (interactively CMD only waits for console programs). Seestart /?for help on this (it explains starting programs with and without usingstart- new behaviour is from Windows 2000 compared with Windows NT4). You probably should be usingpython, however seestart /wif you want to use the GUI python in a console it's not designed for.startwithout the/w.