Computing.Net > Forums > Windows NT > Batch files and batch commands

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch files and batch commands

Reply to Message Icon

Name: Angelique Gulermovich Eps
Date: September 9, 1999 at 16:38:39 Pacific
Comment:

Please excuse the newbie question. I find myself doing something completely out of my ken and would really appreciate any help you can give me. I'm one of the programmers a web-based application that runs on an NT server. We've found that its performance is seriously slowed by the log files created each time it is used. Now, I know nothing of NT, and am not in the same location as the server. (Well, I don't know "nothing" anymore, but close enough.)

What I need to do is to create a batch file that moves C:\theApp\WP*.job files to the D:\Old Jobs\ diretory. It should only move the files that were last modified more than 24 hours ago. The assignment is to execute the batch file when the server is rebooted, but given what I have learned about NT it sounds much wiser to use the Schedule service instead.

I am running serious into problems figuring out how to write the batch file since I don't have an NT machine. Obviously, I need to know the NT batch commands; so far, every reference I've looked at has said to look at the NT Commands help file for them. I can't do that. I'd greatly appreciate any help you could give me.

Thanks,

Angel



Sponsored Link
Ads by Google

Response Number 1
Name: Anthony
Date: September 10, 1999 at 06:37:16 Pacific
Reply:

There is a product made by Wilson Window Ware called WinBatch. It would be the ideal solution to your problem. If you would like I will make an exe file to do what you like and you can use the scheduler service or Win AT commands to have it run once a 24 hour period. Email me and we will talk.


0

Response Number 2
Name: Angel
Date: September 10, 1999 at 10:26:07 Pacific
Reply:

Thanks for your help, Anthony. I'm afraid that I can't use any utilities. Does anyone know where I can find documentation for NT batch commands (other than in the online help)?


0

Response Number 3
Name: Hannes
Date: September 20, 1999 at 07:28:05 Pacific
Reply:

You can read the syntax for XCOPY, AT, CMD with the Commandline-Interface in NT (MS-DOS).
You need to start the SCHEDULE-Service in NT
You need a Batch for Example:

REM BACKUP.CMD
REM Batch to copy from C:\theApp\WP*. to D:\Old
xcopy c:\theApp\*.* d:\old\ /S/D

to use this batch use the COMMAND AT for Example
at 15:00 /every:date,M,T,W,TH cmd /C "c:\backup.cmd"

Maybe, that the Syntax is not completly correct, because I use a German Version of NT


0

Response Number 4
Name: Philippe Heeren
Date: August 24, 2000 at 02:12:56 Pacific
Reply:

I'm having a similar kind of problem. I can shedule a task and so, but the task itself isn't quiet what I want.
I want to run a script that backs up only files older than seven days.

I don't have any clue on how to substract in the command prompt.

I have already a line that sets the date in variables for the month and the day.

The batch version is used with 2 % signs and the command line one is with only one % sign.

for /f "tokens=1,2 delims " %i in ('date /t') do for /f "tokens=1,2,3 delims=/" %a in ("%j") do set month=%b

So here I set the month. If I use %a I set the day.
I was thinking of creating from which I read the "7 days before day" based on the current day. So this file could look like a list of all possible dates in the future followed by the date seven days before.


This is not the way of doing a good batch in NT, so if ANYBODY, and I mean ANYBODY has an idea, please help. I will post replies if I found a solution myself.

Thanks


0

Response Number 5
Name: Joe Hillenbrand
Date: September 12, 2000 at 08:16:43 Pacific
Reply:

I run updates of a certain software frequently. It creates directories with older versions for rollback. I want to delete any more than 4 directories. How can I get a dos batch file to count directories and delete the oldest in an NT environment.


0

Related Posts

See More



Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

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


Go to Windows NT Forum Home


Sponsored links

Ads by Google


Results for: Batch files and batch commands

Delete files and subdirs via batch www.computing.net/answers/windows-nt/delete-files-and-subdirs-via-batch/19437.html

Batch command www.computing.net/answers/windows-nt/batch-command/4321.html

batch command www.computing.net/answers/windows-nt/batch-command/20336.html