Go Back   PCMech Forums > Windows Support > Windows Legacy Support (XP and earlier)

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 11-01-2002, 07:04 AM   #1
Member (14 bit)
Premium Member
 
TwoRails's Avatar
 
Join Date: Jan 2002
Location: The Great NorthWest
Posts: 12,594
How To Batch...??

Hi All,

Have to admit, being a Win 98.2 guy, that I know nothing about XP.

What I need to do is time certain things, like a large file copy, on two different machines. On my 98.2 box, it's easily done with a batch file, but how do you do it on the XP box (which I do Not have access to)??

My understanding is XP doesn't do DOS, and therefore doesn't do batch (.bat) files.

Whatever method that works has to work the same on both machines.

Any Ideas??

Thanks,

TwoRails
TwoRails is offline   Reply With Quote
Old 11-01-2002, 09:25 AM   #2
Member (9 bit)
 
TheOldMan's Avatar
 
Join Date: Feb 2002
Location: State of Confusion
Posts: 386
Hi TwoRails,

XP (and NT and Win2K) is not built on DOS but it has a command prompt instead of a DOS window. It's the same functionality. Instead of BAT files, you use command (.CMD) files.

Depending on how you did the timing, the same file may work on XP. You just change the extension to CMD.

Hope that helps.
The Old Man
TheOldMan is offline   Reply With Quote
Old 11-01-2002, 09:41 AM   #3
Member (14 bit)
 
reboot's Avatar
 
Join Date: Mar 1999
Location: Kelowna, B.C., Canada
Posts: 9,138
If the path to the files is the same in 98 as XP, then the same .bat file should work.
Put it in task manager to run at the scheduled time.
I've never had to rename the extention to .cmd though...that's a new one for me.
__________________
Black holes are where God divided by zero...
Cheers, Jim

Jims Modems
reboot is offline   Reply With Quote
Old 11-01-2002, 11:17 AM   #4
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
Even though XP doesn't have DOS, it still has a command line interface, and you can use the standard DOS commands there (copy, del, ren) and stick them in a batch file. I use batch files for defragging, backups, etc.
doctorgonzo is offline   Reply With Quote
Old 11-01-2002, 11:26 AM   #5
Premium Member
 
Statica's Avatar
 
Join Date: Jun 1999
Posts: 9,231
Or if you'd like it timed you can use the at command to schedule it .. and it will do it even on a remote computer. Do a at /? to view the help.
Statica is offline   Reply With Quote
Old 11-01-2002, 05:39 PM   #6
Don't tread on me
 
cobra's Avatar
 
Join Date: Mar 1999
Location: Florida
Posts: 2,121
Send a message via ICQ to cobra Send a message via AIM to cobra
Quote:
Originally posted by Statica
Or if you'd like it timed you can use the at command to schedule it .. and it will do it even on a remote computer. Do a at /? to view the help.
or new for win2k
the soon command which I have started to like a lot.
__________________
Miami, flee it like a native.
cobra is offline   Reply With Quote
Old 11-01-2002, 08:47 PM   #7
Member (11 bit)
 
Join Date: Jan 2002
Location: british columbia canada
Posts: 1,361
could one of you experts tell me line by line exactly how to create a batch file to run scandisk defrag at a certain tme i would surely appreciate it .With windows xp
thankyou
newme is offline   Reply With Quote
Old 11-02-2002, 10:28 AM   #8
Member (14 bit)
Premium Member
 
TwoRails's Avatar
 
Join Date: Jan 2002
Location: The Great NorthWest
Posts: 12,594
Hi All,

Thanks for the tips. Sorry I wasn't clear with the word time. I was wanting to see how long it took to complete something on each box.

Below is a batch file that works on a 98 box; would it work on an XP box? The rem / comments added here for clarity (I hope )::


rem Time needs the Enter keypress. enter.txt is the required Enter keypress
time < enter.txt

rem I don't want the displayed time to scroll off the screen, so turn off "echo,"
rem and use the /Q (Quite) switch with the xcopy command
echo off
xcopy d:\thisDirectory\*.avi d:\thatDirectory\*.avi /Q

rem turn echo back on and show the time of completion
echo on
time < enter.txt


Now I can subtract the two times and see how long this took.

From what I read above, I believe all I have to do is change the .bat to .cmd on an XP box and it should run??



TwoRails
TwoRails is offline   Reply With Quote
Old 11-02-2002, 10:46 AM   #9
HOT ROD
 
lil Jimmie's Avatar
 
Join Date: Sep 2000
Location: On the Edge
Posts: 4,565
Hi TwoRails, I tried the batch file you have posted, I only edited the file/folder locations and it did copy the files, but didn't give any time for the process and exited upon completion.

BTW I saved it as a .bat file
__________________
Fast enough 2 get by.....old enough 2 know what not 2 try -You know it was me
lil Jimmie is offline   Reply With Quote
Old 11-02-2002, 12:08 PM   #10
Member (14 bit)
Premium Member
 
TwoRails's Avatar
 
Join Date: Jan 2002
Location: The Great NorthWest
Posts: 12,594
Hi lil Jimmie,

Since it appears to work pretty close to Win 98.2, add:

Pause

as the last line in the batch file. This will require any keypress to continue.

If you still don't see the time, you can redirect the output by appending this to the Time command line:

> time1.txt

so it will now look like:

time < enter.txt > time1.txt
echo off
xcopy source destination /Q
echo on
time < enter.txt > time2.txt


then you can look at the two time text files to see the times.

TwoRails

PS: I don't know if XP's Time requires the enter.txt part.
Also, you can (in Win 98.2, anyway) type "/?" after any command to see what switches are availible. Try, "Time /?". In Win 98, there are no Time switches.
TwoRails is offline   Reply With Quote
Old 11-02-2002, 12:30 PM   #11
Member (11 bit)
 
Join Date: Jan 2002
Location: british columbia canada
Posts: 1,361
i dont get it ,how could i do this with defrag and scandisk or can you?
newme is offline   Reply With Quote
Old 11-02-2002, 03:32 PM   #12
Member (9 bit)
 
TheOldMan's Avatar
 
Join Date: Feb 2002
Location: State of Confusion
Posts: 386
Tworails,

To display the date or time to the display, just use
date /t
or
time /t.

As others have mentioned, it looks like there is backwards compatability so you can use the BAT extension also.

Newme,

- Use any text editor and create a new file. Call it DailyScan.cmd or something like that.
- Enter the commands, one per line, as you would have entered them on the command line. Something like defrag defrag C: -a -v as an example.
- If you want to window to stay open when finished, use a pause command. This will cause it to wait for a key to be struck. You can also pipe the output fro the commands to a text file so you can see the results.
- Save the file and close the editor.
- Depending on the editor used, you may need to remove the txt extension from the file
- Test the file by double-clicking it
- If all works as desired, you can schedule the task. Go into XP Help and Support and look up Scheduled tasks for a step by step procedure.

Hope that helps.
The Old Man

Last edited by TheOldMan; 11-02-2002 at 05:35 PM.
TheOldMan is offline   Reply With Quote
Old 11-02-2002, 04:02 PM   #13
Member (11 bit)
 
Join Date: Jan 2002
Location: british columbia canada
Posts: 1,361
i went directly to the command prompt to see what the command for defrag is. i tried defrag C:defrag[f] the f for force doesnt work.what do i put in the command line to make the defrag program work.
thankyou
newme is offline   Reply With Quote
Old 11-02-2002, 04:52 PM   #14
Member (14 bit)
Premium Member
 
TwoRails's Avatar
 
Join Date: Jan 2002
Location: The Great NorthWest
Posts: 12,594
Thanks TheOldMan and Everybody for the assistance !!



TwoRails
TwoRails is offline   Reply With Quote
Old 11-02-2002, 05:34 PM   #15
Member (9 bit)
 
TheOldMan's Avatar
 
Join Date: Feb 2002
Location: State of Confusion
Posts: 386
newme,

It should read defrag C: -f

Sorry for typo in original message.

The Old Man

Last edited by TheOldMan; 11-02-2002 at 05:36 PM.
TheOldMan is offline   Reply With Quote
Old 11-02-2002, 06:07 PM   #16
Professional gadfly
 
doctorgonzo's Avatar
 
Join Date: Jan 2002
Location: Minneapolis, MN
Posts: 6,364
Send a message via MSN to doctorgonzo
Here is my scheduled defrage batch file:

cd \
defrag c: -v >defrag1.txt


The report is saved in a file called "C:\defrag1.txt" that I can look over later.
doctorgonzo is offline   Reply With Quote
Old 11-02-2002, 07:22 PM   #17
HOT ROD
 
lil Jimmie's Avatar
 
Join Date: Sep 2000
Location: On the Edge
Posts: 4,565
Ok I used the "pause" and the "/t" and it seems to work, but shows the time in hh:mm am/pm how can I change the time format to show hh:mm:ss am/pm?
lil Jimmie is offline   Reply With Quote
Old 11-02-2002, 09:47 PM   #18
Member (11 bit)
 
Join Date: Jan 2002
Location: british columbia canada
Posts: 1,361
okay i did the command and when i click on it command window opens up and says analysis report
37 gb total 32 gb(88%)free
19% fragmentation 38%file fragmentation
i can hear it working(i think) but the windows defrag program doesnt appear,is this because its in the command program, and those percentiles dont move they stay the same.does this sound right.sorry havent been using xp very long.
newme is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 04:16 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2