Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automate an action

Status
Not open for further replies.

Mungovan

Programmer
Oct 24, 2002
94
IE
Hi.
I have a session in Windows 2000 that keeps on timing out when there is no action by the user. The session needs to run for 10 hours but times out in 6 if there is no input by the user. Is there any way that the you can simulate a mouse movement or something every few hours so the session won't time out. As it's being run at night it's not possible for someone to be there. It's not possible to change the timeout parameter either. Thanks for any help in this regard.

D
 
It depends what you mean by an "action", if you mean something that the processor must handle. You could create a windows schedule that launches a batch file that just closes it's self.

Hope this Helps.

Neil J Cotton
njc Information Systems
Systems Consultant
 
Hi,
I was thinking along the lines of a batch file as well, I think that would work.
Do you know how I could write it to perform this task (of just opening and closing itself?).

Thanks again.
D
 
Code:
exit

LOL

Hope this Helps.

Neil J Cotton
njc Information Systems
Systems Consultant
 
then stick it in a Windows Scheduler to run every night XX:XX hours.

Hope this Helps.

Neil J Cotton
njc Information Systems
Systems Consultant
 
Hi.
Thanks for the reply. Unfortunitly it won't be possible to run the scheduler for security. Is it possible to start the task and then have the command work say '3 hours later', or at 16:00, or something like that?

Thanks again,
D
 
Once you the program has exited, it is stopped. The only way to launch something on a schedule, is with windows scheduler. Another wacky idea for you.

Create a service that monitors a registry ID. Create a group policy that changes say HKLM\Software\KeepAlive::KeepAliveValue

in your policy, create a GPO and assign the setting to say 1.

create a service that when it starts it gets the registry value and changes it to 2. when GP refreshes (every 90-120 minutes by default), it will see that the key is different, and change it back to 1, when the GPUpdate chanmges the value back to 1, your service will detect the change, and change it back to 2, and so on.

This will work, but as I mentioned earlier, it depends what your program classes as "activity" as to not shutdown.

Hope this Helps.

Neil J Cotton
njc Information Systems
Systems Consultant
 
Did the above solution sort your problem?

Hope this Helps.

Neil J Cotton
njc Information Systems
Systems Consultant
 

Sorry, it seems my last post didn't go through. I'm just trying to figure out if I can access scheduler on the system, it seems that they're a bit fussy about it because of security, limited access etc.
 
what about the service concept that I posted. Scheduler would be easier. I have written a service that does exactly this. Well, pretty much.
All you would need to do is install it on the machines you want it to run. They would need .Net framework 1.1 minimum.

Hope this Helps.

Neil J Cotton
njc Information Systems
Systems Consultant
 
I tried using scheduler but it just says 'Counld not start' under the status option after the time has gone. Unfortunitly I won't be able to install anything new onto the system.

D
 
You got a could not start messge because Exit is not an executable command.

have the task scheduler execute the following command

cmd.exe /c

This tells the system to open a command prompt and close it immediately.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
exit, inside a .bat script works.

Hope this Helps.

Neil J Cotton
njc Information Systems
Systems Consultant
 
I knew where you were going Neil, but Mungovan took your advice litterally and attempted to run the command from the scheduler rather than inside a BAT.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
I realised after I posted. :).

Who are "they" that wont let you install a service for your program, assuming that they let you isntall the application you are having problems with, you could just tell them that it's a new patch. And what implications are their for security of a scheduled job running on the server. As long as it isn't being shared, and external enteties don't have access to create .job files on the target server, I don't see what the problem could possibly be.

Hope this Helps.

Neil J Cotton
njc Information Systems
Systems Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top