Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > PsTools
  New Posts New Posts RSS Feed - defrag chkdsk batch
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

defrag chkdsk batch

 Post Reply Post Reply
Author
Message
vande View Drop Down
Newbie
Newbie


Joined: 12 October 2008
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote vande Quote  Post ReplyReply Direct Link To This Post Topic: defrag chkdsk batch
    Posted: 20 November 2008 at 3:52pm

I was writing a batch file to start defrag c: -f

followed by chkdsk /F

follwed by shut down -r

 

My logic here is that I want to defrag

and batch files follow in procedural order

so when defrag is done then chkdsk can start

the parameters i have is /F <-- which fixes any bad sectors but needs a restart to do so so what i did was echo y | chkdsk /F

followed by shutdown -r

 

this reboots PC in 30 seconds

 

Now I am having some troubles because if i don a batch file i need to input a start %computer name% then my logic code

so with psexec i see that you can @file
 
And read line by line
 
so i was gonna try to make a txt file with all %computer name% and i was reading on it and it reads by dillimited line jumps. Dont really know the wording to explain what i mean but type %computer name% hit enter and make your whole @file read off these %computer name%'s
 
I'm not really to sure if i got this right first off it kept defaulting to another .txt and actually a whole other folde. I guess i could try to this
@"c:\temp\defraglist.txt"
 
Someone clue me in a bit am i going about this ok ?
 
Would it be easier if i didnt use psexec and tried batch file
 
I mean i guess i could try some thing like
 
%computer name%, %computer name%, %computer name% | defrag c: -f
 
Any ideas
 
 
PS. I know i can make a group policy to do this but im not the server admin here im the little desktop guy that has been tasked to start defrag on multiple computers on my off friday
V@nd3
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down