Computing.Net > Forums > Disk Operating System > Batch Files - Logoff Scripts

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.

Batch Files - Logoff Scripts

Reply to Message Icon

Name: mcocker
Date: January 30, 2004 at 08:40:52 Pacific
OS: XP
CPU/Ram: 2GHz/512MB
Comment:

I understand that XP's command prompt isn't true DOS, but I'm sure the batch file commands will still apply.

Here's my question: I want to copy a directory from an XP box to my file server everytime the user logs off. Easy right? Well here is the trick. The folder I wan to backup on the XP box has dated files. I only want to copy the most recent file over to the server. Also, any files in both the XP folder and file server folder that are older than 2 months old should be removed.

Example: XP has C:\Backup\11-29-03.bak that I want copied to P:\Backup (file server). If XP has a new backup file (01-30-04.bak) I want to only back it up to the server. I also want to remove the old backup (11-29-03.bak) from both the server and XP. Keep in mind that my directories and naming conventions aren't exactly like this, for security reasons.

Thanks in advance.

Mike



Sponsored Link
Ads by Google

Response Number 1
Name: Wengier
Date: January 30, 2004 at 18:11:19 Pacific
Reply:

DOS batches and WinNT Console batch scripts are very different in both syntax and appearence of course, though WinNT/2K/XP does understand many or most (not all!) of the synatax of DOS batches (for some backward compatiblity actually) as well as the syntax of the WinNT Console batch scripts. For DOS batch commands, what you want to do can't be done without additional DOS batch tools, and/or do some programming/tricks by yourself; but the different WinNT Console batch scripts don't really belong to the DOS forum. So, it's still a good idea to post your question in the Programming Forum or Windows XP Forum rather than the DOS Forum, as the rule (warning messages) of this forum says, and you will probably get a better chance to be answered there.


0

Response Number 2
Name: Wengier
Date: January 30, 2004 at 18:58:28 Pacific
Reply:

Below are some quotations from the following site:

http://www.batch.hpg.ig.com.br/

"(Here are) Batch scripts for Windows 9x, not NT. All scripts contained in this page were developed and tested under Windows 98 Second Edition (DOS). These scripts are likely to work on other DOS based systems, such as previous versions of DOS. However, since there are many differences between NT batch scripting and DOS batch scripting, some of these scripts might not work under NT systems (Windows NT,2K,XP). In fact, I do not recommend you to use any of this code on a NT system unless a note stating otherwise is made."

On the other hand, NT batch scripting won't work on DOS systems, since DOS can't understand NT batch scripting.

Please read that site (http://www.batch.hpg.ig.com.br/) for more information and lots of useful examples.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


Com port stays open fault in ms-dos extender



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch Files - Logoff Scripts

batch file login script www.computing.net/answers/dos/batch-file-login-script/10872.html

DOS Batch File Help www.computing.net/answers/dos/dos-batch-file-help/15090.html

Batch files www.computing.net/answers/dos/batch-files/9418.html