Hi,
I'm planning on setting up remote access to my laptop via a VNC server.
But something that's hindering my initial attempts is that when the program hangs or crashes I've no way or restarting it (when not at that location).
So ideally I'm looking for a program that would close the server maybe every 2hr's and then restart the program so its error/hang/crash free.
Is this possible? Is there a specific program or a command prompt run?
Cheers in advance.
-
-
Thanks for the tip.
I created a file autorestart.cmd with notepad and put the following in;
:start
C:\Program Files\UltraVNC\winvnc.exe
sleep 10
pskill winvnc.exe
goto start
but when I open the file it just repeats itself over and over in a cmd window.
What should be in the file? Cheers for help! -
jackluo923 Notebook Virtuoso
Maybe you're telling it to restart every 10 seconds
-
davepermen Notebook Nobel Laureate
sounds fine except for sleep 10, as it only sleeps for 10 milliseconds? dunno how sleep works, wait..
ok sleep doesn't even exist in vista(did it ever..
).
oh, another idea:
go into the taskplaner, and create a task you run all 2 hours (should be able to configure it that way).
and there put in the batch, make it that way:
pskill winvnc.exe
winvnc.exe
and put that file (together with pskill) into the ultravnc folder, where winvnc.exe is.
that should do the trick. i hope. -
It seems Task Scheduler only works for daily events, not by the hour.... better that nothing I guess. EDIT: Actually it does, its in the advanced options after you've set it up.
How would I get the .cmd file to work? Is it possible? -
jackluo923 Notebook Virtuoso
Maybe you should switch to remote desktop protocal. It's much faster/responsive and it's more reliable.
E.g use live mesh from mesh.com -
OK set up that .bat file to be hit by the scheduler. It just triggered and the program did not restart. (it wasn't open before trigger)
-
-
Right this is the .BAT file at the moment, and its opening the server but it doesn't kill it initially so I'm thinking there's a problem with the pskill command;
pskill winvnc.exe
start "" "C:\Program Files\UltraVNC\winvnc.exe" -
Working!
Working at the moment; had to move the .dll file that came with pskill.
This is the current file;
pskill "winvnc.exe"
ping 1.1.1.1 -n 1 -w 10000
start "" "C:\Program Files\UltraVNC\winvnc.exe"
(with the delay just so I can see it happening).
Had to move pskill into System32 folder. But seems to working fine now - thanks all. Rep on the way. -
jackluo923 Notebook Virtuoso
Beware that if you move something to System32, in rare cases, that the file will be removed if you do not take ownership of the file or a antivirus sees it as a virus.
-
Code:
@echo off cls :program echo (%date%-%time%) program started. start /wait name_here.exe echo (%date%-%time%) program crashes, restarting goto program
Sorry if i've misunderstood something..
but if you put that as a bat into the same dir as the .exe and replace the name_here.exe with the program exe name, then launch it, it will monitor if the exe (process) is running, if not it will restart it instantly) -
-
Oh... yeah okay.. cant help ya there
auto-end and restart sometimes like guys above mentioned is probably the only way -
ScuderiaConchiglia NBR Vaio Team Curmudgeon
Gary -
I don't think VNC is unreliable at all, I've not have a crash yet. But if I'm abroad and trying to get back to the laptop and it crashes I've a fairly insurmountable problem.
EDIT: I probably give Windows Remote Desktop ago after I've all this set-up, maybe as a back-up for this. Or ifs it better the primary route. -
ScuderiaConchiglia NBR Vaio Team Curmudgeon
Gary -
-
I can vouch for the Remote Desktop feature in Windows as well (albeit not with such longevity and authority as Gary
). I've never had it crash or go wonky, even when running over a dubious broadband connection from many, many miles away from home.
-
ScuderiaConchiglia NBR Vaio Team Curmudgeon
...big ol' grin...
Gary
How to have a program automatically restart if it hangs or crashes
Discussion in 'Windows OS and Software' started by 72hundred, Jun 16, 2009.