Frequently, I need to close and restart some java based windows ( running in DOS environment ) in Windows NT 4 Server.
I wish to close the windows in the remote Widnows NT Server from a client machine usign AutoHotkey.
any idea or suggestion on how to close a remote application window from a client machine?
Closing applications in remote windows
Started by
sl_alagappan
, Apr 10 2004 05:28 AM
7 replies to this topic
#1
-
Posted 10 April 2004 - 05:28 AM
If you've accomplished how to identify such JAVA/DOS window, you could run an AHK script (24/7 or scheduled) on the remote box to close that window, without any need of remote action.
#3
-
Posted 10 April 2004 - 09:43 AM
Similar to the above idea, you could have a script running on the remote machine that watches for certain semaphore (signal) file to exist. Such a file can be created via a mapped drive on either machine (or perhaps by using a UNC directly). For example:you could run an AHK script (24/7 or scheduled) on the remote box to close that window, without any need of remote action.
Loop { IfExist, M:\StartJob.txt ; A remote user created this file to tell us to start. { FileDelete, M:\StartJob.txt ; Reset for the next time Run, Whatever.exe } Sleep, 1000 }
#4
-
Posted 10 April 2004 - 12:32 PM
Here is an example of a program I wrote that runs on remote computers that lets me start any application I want remotely and kill remote programs.
rkill can be found at http://www.autohotke...wtopic.php?t=95
Then on my local PC I wrote a batch job to create the INI file and copy it to the remote PC.
thanks,
beardboy
Loop { IFExist, %A_SCRIPTDIR%\trimmenu.ini { GoSub, INI } Sleep, 1000 } INI: IniRead, type, %A_SCRIPTDIR%\trimmenu.ini, General, Type IniRead, program, %A_SCRIPTDIR%\trimmenu.ini, General, Program IniRead, options, %A_SCRIPTDIR%\trimmenu.ini, General, Options if type = kill { if options = winkill { WinKill, %program% } if options = rkill { RunWait, %comspec% /c rkill /nkill \\%computername% %program%,,hide } } if type = start { Run, %program% %options% } FileDelete, %A_SCRIPTDIR%\trimmenu.ini return
rkill can be found at http://www.autohotke...wtopic.php?t=95
Then on my local PC I wrote a batch job to create the INI file and copy it to the remote PC.
@echo off set v=%1 Title Trimmenu Start / Kill echo Trimmenu Start / Kill :start echo ------------------------------------------------ IF "%v%" == "" set /p computer=What PC would you like to do something on? IF NOT "%v%" == "" set computer=%1 IF "%computer%" == "exit" GOTO END set /p sork=Would you like to start or kill? set /p program=What program (remember full path if needed)? set /p options=Options (Example: /c /d)? IF NOT EXIST \\%computer%\c$ echo %computer%: Computer is not available&set v=&GOTO START echo [General]>trimmenu.ini echo Type=%sork%>>trimmenu.ini echo Program=%program%>>trimmenu.ini echo Options=%options%>>trimmenu.ini move trimmenu.ini \\%computer%\c\winnt\ echo. echo Command sent to %computer% echo. IF "%2" == "done" GOTO END set v=&GOTO START :END title C:\WINNT\System32\cmd.exe
thanks,
beardboy
#5
-
Posted 10 April 2004 - 02:27 PM
thanks all for yr replies.
I hv implemented similar method to close the remote windows ( a schedular running to check for existance of a file. If found, the autoit v2 script will close all the remote windows and restart the app ).
But the problem, I face is that, when u close and restart the remote windows for the first time, there is no problem. but for the second and consecutive times, there are kernel errors from Windows NT when I kill process using kill.exe. Not sure whether it is due to windows nt or the java app or the autoit v2 script.. I need to come down to office to restart the server manually in this case during night times.
I know the window title and text of the windows to be closed.
What I want is to close windows in order. Once closed a window, check whether it has been safely closed before closing the next window.
I have an existing VB 6 application which I need to interact with. Once the user click a button in VB app, the vb program should iniate the window closing process using autohotkey. For each window close, I need a confirmation from autohotkey script whether the window is safey closed to my vb program. Once all windows are closed, I need to get confirmation to the vb program so as to inform users what is happening on the remote server.
any possible way of achieving this without affecting windows nt?
I hv implemented similar method to close the remote windows ( a schedular running to check for existance of a file. If found, the autoit v2 script will close all the remote windows and restart the app ).
But the problem, I face is that, when u close and restart the remote windows for the first time, there is no problem. but for the second and consecutive times, there are kernel errors from Windows NT when I kill process using kill.exe. Not sure whether it is due to windows nt or the java app or the autoit v2 script.. I need to come down to office to restart the server manually in this case during night times.
I know the window title and text of the windows to be closed.
What I want is to close windows in order. Once closed a window, check whether it has been safely closed before closing the next window.
I have an existing VB 6 application which I need to interact with. Once the user click a button in VB app, the vb program should iniate the window closing process using autohotkey. For each window close, I need a confirmation from autohotkey script whether the window is safey closed to my vb program. Once all windows are closed, I need to get confirmation to the vb program so as to inform users what is happening on the remote server.
any possible way of achieving this without affecting windows nt?
#6
-
Posted 12 April 2004 - 04:03 AM
WinClose and WinKill both support an optional "wait until closed" parameter. You could also use WinWaitClose.
#7
-
Posted 12 April 2004 - 04:11 AM
... and you could set/hold the current status of each window/process in an INI:
[PROCSTAT]
win1=YES
win2=YES
win3=NO
VBConfirmation=NO
[PROCSTAT]
win1=YES
win2=YES
win3=NO
VBConfirmation=NO
#8
-
Posted 12 April 2004 - 09:12 AM