Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


CHKDSK problem

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,53182
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> CHKDSK problem
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 CHKDSK problem - 11/1/2007 1:58:11 AM   
  sudhir_shet

 

Posts: 8
Score: 0
Joined: 11/1/2007
Status: offline
Hi,
    I am a newbie to VB Scripting. I am trying to call "chkdsk c: /f /r" within VB Script. It hangs since, the chkdsk asks another confirmation of "Y/N" for this command. How can i pass this Y or N with in the script??

Could any one help?

Thanks..
 
 
Post #: 1
 
 RE: CHKDSK problem - 11/1/2007 2:19:23 AM   
  dm_4ever


Posts: 2663
Score: 46
Joined: 6/29/2006
From: Orange County, California
Status: offline
What if you tried...

%comspec% /c echo Y | chkdsk c: /f /r

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to sudhir_shet)
 
 
Post #: 2
 
 RE: CHKDSK problem - 11/1/2007 2:23:12 AM   
  sudhir_shet

 

Posts: 8
Score: 0
Joined: 11/1/2007
Status: offline
Thanks it works.. :-)

(in reply to dm_4ever)
 
 
Post #: 3
 
 RE: CHKDSK problem - 11/1/2007 4:19:24 PM   
  sudhir_shet

 

Posts: 8
Score: 0
Joined: 11/1/2007
Status: offline
Now if the chkdsk command 2 input, once it asks whether to dismount the volume and then it asks if to schedule on restart! In this case, how can i pass 2 parameters to the chkdsk command? Is it possible using Pipe operator??

I tried cmd /c echo Y | echo N | chkdsk d: /r, but this doesnt work!

Could anyone help?

(in reply to sudhir_shet)
 
 
Post #: 4
 
 RE: CHKDSK problem - 11/5/2007 10:01:20 AM   
  morpheus83uk

 

Posts: 379
Score: 0
Joined: 8/21/2006
Status: offline
Hello,

What about:

Set WshShell = CreateObject("WScript.Shell")

%comspec% /c echo Y | chkdsk c: /f /r

WScript.Sleep 2000
WshShell.SendKeys "N"
WScript.Sleep 2000
WshShell.SendKeys "{ENTER}"

That might work but there again its a very crude way of doing it but if it works for the time being I am sure it would be useful unless someone else has a diffrent approach which is much better go with that :)

Hope this helps

James

(in reply to sudhir_shet)
 
 
Post #: 5
 
 RE: CHKDSK problem - 11/5/2007 3:04:56 PM   
  DiGiTAL.SkReAM


Posts: 1184
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
Here's a portion of a script that I used once... it lets me schedule a chkdsk for next reboot, and then clear that setting right after it boots into Windows again.
I've added comments for a "walkthru"


      


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to morpheus83uk)
 
 
Post #: 6
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> CHKDSK problem Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts