When I try to stop the Microsoft FTP Service using the net stop ftpsvc command in a Windows 7 32bit (IIS 7.5) machine it just says stopping and ....... and hangs. It remains there indefinitely, I can't stop or start it.
When I look at the processes through task manager I can see svchost ftpsvc running, I try to kill it using teh task manager (from the Process Details page) nothing happens. I try to kill it using taskkill and the PID through an administrative command prompt and it says process terminated but i can see if running in task manager process details. I try to kill it using process explorer and nothing happens.
This happens is a user is downloading a file and then I try to do a net stop ftpsvc in between.
There are no child processes. Any idea what's going on and if there's some way to kill this process without rebooting?
Did you try force-kill?
Run this from command line:
sc queryex ftpsvc
Then you will get Process Id which can be used to taskkill with f switch:
taskkill /f /pid [PID]
Go to the process details section of task manager and kill the process. We have a message query service that often refuses to stop. Then refresh the services page and start it again.
Second part: The file will be partially uploaded or downloaded. It is the client applications responsibility to do those checks. There will be no locks on ftp.
Related
I am trying to hack together an automated Icon Cache delete, and everything is working fine when I initiate the scripts manually. In PowerShell I use TaskKill to kill Explorer.exe, Sleep for 10 seconds so the icon cache DB files are no longer in use, then delete them and restart Explorer.exe with Start-Process. I am also using a VBScript to launch the PowerShell script as I want this to happen transparently to the user.
The final implementation involves running everything by way of the Run key in the Windows registry. That triggers my script that has a mechanism for running this only once, but for every user who logs on to the machine.
The problem SEEMS to be that killing Explorer.exe also kills the script that was launched via Run, so it never has a chance to write to the registry in Current User that this task has completed. Thus Explorer.exe is restarted on every single logon, which is not desirable.
Is this a known interaction between Explorer.exe and things launched via the Run key? Or might there be something else going on?
If I run the following command in my session...
(Get-Process -Id $pid).CloseMainWindow()
I am able to gracefully shut down a process (no modal windows or other popups arise).
If, however, the pid is in another user's session on the same machine (running RDS), the process does not close, and CloseMainWindow() returns FALSE (it returns TRUE if it's running in my own session). It also works if I run the powershell from the other user's session.
I specifically need a way to gracefully shut down the program as the program has a few important cleanup actions required to keep its database in order. So stop-process or process.kill() will not work.
After lengthy research, it does not seem possible to do this. There is, however, a solution which met at least some of my requirements.
You can create a Windows Scheduled Task which is triggered on session disconnect. This allows you to run a cleanup job as the user, rather than as the administrator, which allows programs to exit gracefully.
It has two major drawbacks....
It is called even if the user just has a minor network interruption (so you have to build a wait() function in the script to sleep for a bit and then check if it is still disconnected - not a clean solution.
It isn't called during a log-off event. For that you need to use a logoff script triggered by GPO.
Hope this helps someone in the future.
What I have: I have Windows 7 on my home PC.
What I'm trying to do: I'm trying to keep TeamViewer running at home so I can always get to my home computer. The other day it got completely messed up and would not let me connect but everything else on the PC was just fine.
Items I've looked at:
I looked at this thread and it does not seem to apply to what I need:
Is it possible to start Teamviewer, to accept connections, from commandline?
... but it does not appear to be what I'm looking for.
I have looked at this:
https://serverfault.com/questions/48600/how-can-i-automatically-restart-a-windows-service-if-it-crashes
... and to test the script at the above URL, I stopped a service on my computer and pointed the above vbs script to that service and the vbs script will not restart that service, so that's not working.
What's happening:
From time to time on my home computer, TeamViewer hangs or gets messed up in some way and I cannot connect to my home computer. The last time this happened, the TeamViewer UI was still running but there was a little red dot next to the tray icon and the id numbers and password were blank in the UI so I had to right click and kill it and restart the computer and all was OK.
What I'd like to do:
Is there a way I can run some kind of script or something that will completely kill all TeamViewer processes and services and restart it completely? I'd like to schedule this type of activity once an hour so I can be assured of pretty much always being able to get into my home computer or else just wait an hour and it should be back up and available?
I have 20 years in IT with networking background, databases, GUI development, website development, hardware and software installation but no experience in brain surgery. I've given it a good try but am now asking for some help.
Thanks.
I think that task scheduler, taskkill and batch script is your friend here.
create a batch file to stop any current team viewer process and then restart it.
crate a batch file something like:
taskkill /IM TeamViewer.exe
start "" "C:\Program Files (x86)\TeamViewer\TeamViewer.exe"
(substitute the path to TeamViewer.exe on your own machine).
Then create an hourly scheduled task to run the script using the highest privileges (using Windows Task Scheduler).
Lookup taskkill for more info on killing tasks from the command line.
Just to add that you'll have to have the PC in a associated in your teamviewer account in a group (e.g. My Computers) and use the same account to connect - otherwise the password change on restart will prevent you connecting (you won't know the new password).
I am running my installer in silent mode (-q option).
After starting, the installer quits. The error.log shows the entry:
"The application is running. Please close instances and run this installer again".
However, there is no other instance of the installer running.
Note - The installer is launched in the Windows local system account.
I encountered the exact same issue with an updater installer being run in unattended (silent) mode and launched from a Windows service. I discovered that there were two reasons for the updater failing to complete:
The unattended mode installer was being invoked with arguments -q -wait 20 (these are the defaults when generating an updater application using the install4j UI). The -wait argument causes the installer to wait for running applications to close before progressing to the stage where the Welcome screen would normally be shown in an interactive install. It does not attempt to close them itself. If the applications don't disappear within 20 seconds, the installer exits at this early stage with the error.log message "The application is running. Please close instances and run this installer again". (In interactive mode the user would be shown a screen at this stage asking them to close the running applications.)
(Note: -wait only seems to check for the presence of application processes (user launched apps, UIs etc). Installed services that are running are not considered a blocker, probably because they are automatically stopped as part of the Install files action.)
I had already added actions later in my installer to close down the application processes before installing the update, but the -wait argument was not allowing it to progress that far. I removed the argument from the "Set installer arguments" action in the updater app and this allowed the installer to progress beyond the welcome phase.
The 'Check for running processes' action, using a Close strategy of 'Soft close immediately', failed to close any user-launched applications running (UI applications in my case) when the installer was launched from the Windows service. This in turn caused the unattended update to fail due to locking issues overwriting the installed files.
However using the Close strategy of 'Terminate immediately' did allow the service account to successfully kill the running applications and allowed the installation to complete.
I ended up using a sequence of "Stop a service", "Check for running processes (soft close)" (which works when the installer is run in interactive mode by a user), then "Check for running processes (Terminate immediately)" at the start of the Installation section to cover all bases.
I am using Wildfly 9 under both Ubuntu an Windows servers. Sometimes, I need to restart the servers but after I stop the server, I cannot start it again. There is a red message box saying Server start failed. The detailed message is:
WFLYCTL0158: Operation handler failed: java.lang.IllegalStateException
I cannot stop Wildfly because there is a bug on Windows preventing the user from stopping Wildfly server through Services. The process stucks at Stopping but it never stops the Wildfly service. I have to restart Windows itself to make it work again.
Anyone facing this problem? How can I overcome this?
Here is how I got around the "stopping" issue.
To kill the windows service without having to reboot windows, create a batch file call it killwindowsservice.bat or whatever. Put the following in it.
set SERVICE=%1
echo Killing Service %SERVICE%
FOR /F "tokens=3" %%A IN ('sc queryex %SERVICE% ^| findstr PID') DO (SET pid=%%A)
IF "!pid!" NEQ "0" (
taskkill /f /t /pid !pid!
)
Just call your script with the name of the windows service. So for me I call my Windows Services the name of my application server instance. So for eaxmple "Server01".
So for me I would call it like:
killwindowsservice.bat Server01
And the script will kill the windows service.
The Windows service scripts that come with Wildfly 8.x+ DO NOT work on Windows 2012/2012 R2. I have not gotten them to work. I went and grabbed the jbosssvc.exe from a previous version of JBoss and customized the Windows Service scripts that come with it. And they work perfectly. I'm using these scripts on 12 Wildfly servers now without a problem.
This is how I manage Wildfly on Windows:
Open Task Manager
Eanble Command Line column under Details tab
Find Wildfly process (the path will tell you correct instance)
Kill the process
Then the server starts through admin console. You can also kill Wildfly master process and start over.