How stops webdev.webserver.exe - process

how can stops WebDev.WebServer.exe process without kill it??
I can do this:
taskkill /F /IM WebDev.WebServer.exe -works on Windows XP- but another solution without kill the proccess ???

Yeap, you are right, it will kill all process & ASP.NET service
The problem, actually, is how to kill WebDev.WebServer40.EXE, which was run with specified port.
f.e. I have:
WebDev.WebServer40.exe /port:10254 /path:"D:...\Web1"
WebDev.WebServer40.exe /port:10512 /path:"D:...\Web2"
and taskkill /F /IM WebDev.WebServer40.exe
will close all my sites, when I want only one of them
p.s. The Author means stop process == kill process, don't mind

Stopping a process is killing it.
Why do you need to "stop" the process without killing it? What do you mean by "stopping" the process?
You can use this tool to pause and resume processes.

Webdev.WebServer.exe is the development web server used by Visual Studio to allow quick debugging of ASP.NET applications.
Visual studio will stop it for you when it is not needed. What exact problem are you having that you want to stop it explicitly?

Related

How to change windows theme (or at least the background) using the command line or scripts

I am trying to make it so that the theme (or at least the background) changes when I switch desktop view. I have found some answers but most if not all are about old versions of windows and do not work for windows 10. The scripting tool I am using is AHK. Thank you in advance.
Its possible to change the background using this command:
reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v Wallpaper /t REG_SZ /d wallpaper_path /f
Changing the theme is not that direct, you might want to run the following command. What it does is that it will show you a dialog where you can pick the theme you want. (It may also reset your theme to default)
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,#Themes /Action:OpenTheme /file:"C:\Windows\Resources\Themes\aero.theme"
It's although possible to change the theme using this command:
call <path-to-your-theme>
You close the opened window using this command:
taskkill /IM ApplicationFrameHost.exe
I came across this question while looking to do the same thing for my company's computer image. The command below worked well for me, keep in mind that the taskkill part would kill all settings windows
C:\PATH\TO\THEME\FILE.theme & timeout /t 03 /nobreak > NUL & taskkill /f /im systemsettings.exe
This will launch the theme file which will apply the theme but also open the Setting app/window, but then it will wait for the timeout (set to 3 seconds in the command above) then kill the Settings app/window. Tested on Windows 10 Enterprise x64 v1909. Also depending on the performance of the computers you might be able to lower the timeout from 3 seconds.
Martin's answer didnt work for me, but after some reading it believe its because of changes made with either v1809 or v1903

failed to kill a returning process

I have an invisible mspaint.exe process (no open window) that runs apparently at startup on WINDOWS XP.
I tried the usual ways to kill it, but none of them worked.
1) Task Manager: the process disappears but returns immediately.
2) Command Prompt: if I do
taskkill -f /im mspaint.exe
I receive the SUCCESS message BUT the process mspaint remains, with the same PID.
If I specify the PID number, then I also get the SUCCESS message but the process mspaint.exe remains with a new PID.
3) Process Explorer: the kill command has no effect.
There is a parent svchost.exe process that I killed but still I could not get rid of child process mspaint.exe
Any advice is welcome.
Try right-clicking on mspaint.exe in the processes tab in task manager and selecting "Kill Process Tree".
It seems like it could be a virus. I suggest downloading Malware Bytes (free) and doing a scan. http://www.malwarebytes.org

Testing incremental development of windows service

Currently working on a WCF service running as a windows service.
I've made an installer and written a little script which adds a user account for it to run under and then registers and starts the service under than account. And a build step in visual studio to copy it to a discrete folder so we're not running directly off the solution. All works fine.
However, as I extend and improve this service, testing it is becoming a bit of a pain. Each time I want to check my changes I have to stop the service, rebuild, re-start the service and re-attach visual studio to the process before I can step through.
Just wondering if there's a quicker or better method of doing this without writing some proxy host for all the services? Unit tests won't cut it in this instance because the service needs to do system-ish stuff like connecting to Active Directory endpoints.
I know this question is ancient, but I recently solved part of this using build events as follows:
Pre-build event:
if "$(ConfigurationName)" neq "Debug" goto NoStop
echo Attempting to stop windows service MyService
net stop MyService > MyService.log
if "%errorlevel%" neq "0" (call )
type MyService.log
:NoStop
Post-build event:
if "$(ConfigurationName)" neq "Debug" goto NoStart
findstr "/c:stopped successfully" MyService.log >nul
if "%errorlevel%" equ "0" net start MyService
(call )
:NoStart
Features of this approach:
The configuration is checked and if I'm not building in Debug, then the whole bit is skipped.
The NET STOP command will try to stop your service and the if command below it will swallow any errors that might occur. This is great if your service isn't installed or if it isn't running.
Since the service is stopped, the service EXE is unlocked and the build doesn't fail with those annoying "file is locked" errors.
The post-build event will only start the service if the pre-build event was successful in shutting it down. The FINDSTR command searches the log file created during the pre-build event for the string "stopped successfully." If it is found, the NET START is called. Either way, errors are swallowed by the (call ) on the next line.
This is working for me in Visual Studio 2015 running on Windows 7. Hope this helps somebody!

How to run a PHP script via SSH and keep it running after I quit

I'm trying to restart a custom IRC bot. I tried various commands :
load.php
daemon load.php
daemon load.php &&
But that makes the script execute inside the console (I see all the output) and when I quit the bot quits as well.
The bot author only taught me the IRC commands so I'm a bit lost.
You can install a package called screen. Then, run screen -dm php load.php and resume with screen -dR
This will allow you to run the script in the background, and still be able to use your current SSH terminal. You can also logout and the process will still be running.
Chances are good the shell is sending the HUP signal to all its running children when you log out to indicate that "the line has been hung up" (a plain old telephone system modem reference to a line being "hung up" when disconnected. You know, because you "hang" the handset on the hook...)
The HUP signal will ask all programs to die conveniently.
Try this:
nohup load.php &
The nohup asks for the next program executed to ignore the HUP signal. See signal(7) and the nohup(1) manpages for details. The & asks the shell to execute the program in the background.
Clay's answer of using screen(1) is pretty awesome, definitely look into screen(1) or tmux(1), but I don't think that they are necessary for this problem.
This line might help you
php load.php &

How to ensure devenv.exe is not running when my msi is installed

I am writing a VSPackage for Visual Studio 2008, and am deploying it with a WiX generated Msi. As the end of the install, I am running "devenv.exe /setup" as required to get VS to notice my package. However, this command will not succeed if there are any copies of Visual Studio running.
Currently, I tell people they have to close all copies of Visual Studio before installing, but I would prefer it be foolproof. How can I check when someone runs my .msi if any copies of Visual Studio (devenv.exe) are running, and block them from installing my project?
while(devenvIsRunning()) {} //in main routine of Installer class
static bool devenvIsRunning() //uses this subroutine
{
Process[] procList = Process.GetProcesses();
foreach (Process p in procList)
{
if (p.ProcessName == "devenv")
{
MessageBox.Show("An instance of Visual Studio is still running.\nPlease close all open instances of Visual Studio before continuing.");
return true;
}
}
return false;
}
The WiX toolset has a CloseApps CustomAction that will close windows for you. It unfortuantely does not prompt with a list to close all the applications but the code would be a reasonable place to start.
your best bet is to follow Rob's advide and put together a custom action to check if the process is running. I'd probably do something like see if it's running, try to close, if it's still running then schedule a reboot and do the devenv setup
via the RunOnce registry key.
If that's too much work then a bit of an ugly hack would be to use the windows command TASKKILL to exit the application. Not foolproof but it's better than nothing.
TASKKILL /IM devenv.exe
You can create an installer class in your project and let it enumerate Running Processes
I had to use TASKKILL /IM devenv.exe -F to kill the process and cmd had to be run as administrator