PDA

View Full Version : Do [task] on logoff...?



AnokFero
12-03-2009, 01:39 PM
I am currently trying to get to backup certain files whenever I hit logoff. The program GoodSync (http://www.goodsync.com) is what I'm using and has the ability to do tasks when I submit a log off, however the time Windows gives the program isn't enough and it forces the program to close before its finished.

In having two computer crashes in less than what feels like two weeks, I am sick and tired of having to restore certain files when I recreate the data I lost!

Is there a way a noob at scripts can get something to say,

"run tasks"
"Wait till tasks finished"
"Start Logoff"
"Logoff"

Thanks for any help guys.

Speedy Gonzales
12-03-2009, 01:49 PM
If its crashing, it's probably a hardware prob, or something you're installing

WHAT does it say when it crashes

Does it bring up a bluescreen? Is a program crashing?

AnokFero
12-03-2009, 01:55 PM
Re the crashes its due to powerfailure!

The logoff problem is simple in that windows doesn't wait for the program to finish before logging off. I need a way in which I can run the program automatically, wait till its finished, and then logoff because the settings in the program dont allow it to escape the logoff pharse but does start when I press logoff.

A way to get the program to run, finish then logoff is what I need.

Speedy Gonzales
12-03-2009, 01:58 PM
Well I would fix the power then.

If you have them too often, it'll start corrupting files / the hard drive. Then you'll have to replace the hard drive

AnokFero
12-03-2009, 02:01 PM
No way to fix power supply when I have no knowledge of power plugs lol, first time was..... me being ****y and forcing the pc off, the second time the power cord fall out of the plug hole.

So yeah...

Oh well back to finding a solution :)

somebody
12-03-2009, 02:06 PM
You could write yourself a batch script, which does the backup, and the last command it runs is:

shutdown /l

The "shutdown /l" command causes windows to log off.

Speedy Gonzales
12-03-2009, 02:06 PM
So is it the power supply in the case or the power plug on the wall??

If its the one in the case, I would replace it, there's no point in trying to fix windows, if the power supply is dodgy.

You'll be replacing files / or the hard drive forever

Are you in NZ or somewhere else?

If its the wall socket get an electrician to fix it. Or move the computer to a better power point

Blam
12-03-2009, 05:14 PM
You could write yourself a batch script, which does the backup, and the last command it runs is:

shutdown /l

The "shutdown /l" command causes windows to log off.

+1, that would be easiest IMO.

http://www.2brightsparks.com/bb/viewtopic.php?t=38