Can Windows XP do this? (backup)

  • Thread starter Thread starter Kristofer Gafvert
  • Start date Start date
K

Kristofer Gafvert

I would like to backup a few files and folders daily, to a file server. But
i want to do this when i'm finished using the computer for the day, so i
cannot schedule this using ntbackup (as far as i know). And after it has
finished backing up, i want it to either put the computer in standby, or
shut down.

So, simply said, i want an application i can double click manually each day,
and it will backup the selected folders, and then turn off the computer. Can
Windows do this? Any other third-party application that can do this? And
which do not require installing of alot of software, in that case i will
just write my own application, cannot be that difficult.

Oh, and if i can include emails in one or another way it would be even
better. Would like that to be backed up too.

--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003
 
Just put the backup command that it creates in schedule into a shortcut

Look at shutdown command.

cmd /k ntbackup <a million switches and parameters - get them from scheduler>&shutdown -s -f
 
Can shutdown.exe also put the computer in standby? I cannot find any switch
for that.

But you gave me an idea of how simple this can be. I was thinking about
something more advanced, and never thought about a simple cmd :-)

--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003


Just put the backup command that it creates in schedule into a shortcut

Look at shutdown command.

cmd /k ntbackup <a million switches and parameters - get them from
scheduler>&shutdown -s -f
 
rundll32 Powrprof.dll,SetSuspendState



Note I can't guarantee it will always work. As we're passing Null, Null, Null (because it's an ordinary function that doesn't expect to be called from a command line but by a program) to a function that expects values. So it's treating boolHibernate as 0 so can't suspend only hibernate.


Platform SDK: Hardware

SetSuspendState
The SetSuspendState function suspends the system by shutting power down. Depending on the Hibernate parameter, the system either enters a suspend (sleep) state or hibernation (S4). If the ForceFlag parameter is TRUE, the system suspends operation immediately; if it is FALSE, the system requests permission from all applications and device drivers before doing so.

BOOL SetSuspendState (
BOOL Hibernate,
BOOL ForceCritical,
BOOL DisableWakeEvent
);
Parameters
Hibernate
[in] Specifies the state of the system. If TRUE, the system hibernates. If FALSE, the system is suspended.
ForceCritical
[in] Forced suspension. If TRUE, the function broadcasts a PBT_APMSUSPEND event to each application and driver, then immediately suspends operation. If FALSE, the function broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation.
DisableWakeEvent
[in] If TRUE, the system disables all wake events. If FALSE, any system wake events remain enabled.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks
An application may use SetSuspendState to transition the system from the working state to the standby (sleep), or optionally, hibernate (S4) state. This function is similar to the SetSystemPowerState function.

Requirements
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Included in Windows 98 and later.
Header: Declared in Powrprof.h.
Library: Use Powrprof.lib.

See Also
Power Management Overview, Power Management Functions, PBT_APMQUERYSUSPEND, PBT_APMSUSPEND
 
Thanks!

--
Regards,
Kristofer Gafvert - IIS MVP
Reply to newsgroup only. Remove NEWS if you must reply by email, but please
do not.
www.ilopia.com - FAQ and Tutorials for Windows Server 2003


rundll32 Powrprof.dll,SetSuspendState



Note I can't guarantee it will always work. As we're passing Null, Null,
Null (because it's an ordinary function that doesn't expect to be called
from a command line but by a program) to a function that expects values. So
it's treating boolHibernate as 0 so can't suspend only hibernate.


Platform SDK: Hardware

SetSuspendState
The SetSuspendState function suspends the system by shutting power down.
Depending on the Hibernate parameter, the system either enters a suspend
(sleep) state or hibernation (S4). If the ForceFlag parameter is TRUE, the
system suspends operation immediately; if it is FALSE, the system requests
permission from all applications and device drivers before doing so.

BOOL SetSuspendState (
BOOL Hibernate,
BOOL ForceCritical,
BOOL DisableWakeEvent
);
Parameters
Hibernate
[in] Specifies the state of the system. If TRUE, the system hibernates. If
FALSE, the system is suspended.
ForceCritical
[in] Forced suspension. If TRUE, the function broadcasts a PBT_APMSUSPEND
event to each application and driver, then immediately suspends operation.
If FALSE, the function broadcasts a PBT_APMQUERYSUSPEND event to each
application to request permission to suspend operation.
DisableWakeEvent
[in] If TRUE, the system disables all wake events. If FALSE, any system
wake events remain enabled.
Return Values
If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error
information, call GetLastError.

Remarks
An application may use SetSuspendState to transition the system from the
working state to the standby (sleep), or optionally, hibernate (S4) state.
This function is similar to the SetSystemPowerState function.

Requirements
Windows NT/2000/XP: Included in Windows 2000 and later.
Windows 95/98/Me: Included in Windows 98 and later.
Header: Declared in Powrprof.h.
Library: Use Powrprof.lib.

See Also
Power Management Overview, Power Management Functions, PBT_APMQUERYSUSPEND,
PBT_APMSUSPEND
 
Back
Top