|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (14 bit)
Premium Member
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 |
|
|
|
|
|
#2 |
|
Member (9 bit)
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 |
|
|
|
|
|
#3 |
|
Member (14 bit)
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. |
|
|
|
|
|
#4 |
|
Professional gadfly
|
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.
|
|
|
|
|
|
#5 |
|
Premium Member
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.
|
|
|
|
|
|
#6 | |
|
Don't tread on me
|
Quote:
the soon command which I have started to like a lot.
__________________
Miami, flee it like a native. |
|
|
|
|
|
|
#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 |
|
|
|
|
|
#8 |
|
Member (14 bit)
Premium Member
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 |
|
|
|
|
|
#9 |
|
HOT ROD
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
|
|
|
|
|
|
#10 |
|
Member (14 bit)
Premium Member
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. |
|
|
|
|
|
#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?
|
|
|
|
|
|
#12 |
|
Member (9 bit)
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. |
|
|
|
|
|
#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 |
|
|
|
|
|
#14 |
|
Member (14 bit)
Premium Member
Join Date: Jan 2002
Location: The Great NorthWest
Posts: 12,594
|
Thanks TheOldMan and Everybody for the assistance !!
![]() ![]() TwoRails |
|
|
|
|
|
#15 |
|
Member (9 bit)
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. |
|
|
|
|
|
#16 |
|
Professional gadfly
|
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. |
|
|
|
|
|
#17 |
|
HOT ROD
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?
|
|
|
|
|
|
#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. |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|