CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2000
    Location
    Arizona, USA
    Posts
    493

    This is for you DOS guru's (if there are any)

    I have a .bat file that runs chkdsk and then reboots the pc. this is pushed out at night
    on SMS. My problem is that chkdsk requires the user to enter y or n. I need this to be completly automatic. Any Ideas?
    Thanks in advance!!!

    Kris
    Software Engineer
    Phoenix,AZ
    Kris
    Software Engineer
    Phoenix, AZ USA

  2. #2
    Join Date
    Jan 2001
    Posts
    165

    Re: This is for you DOS guru's (if there are any)

    What version is this running under?

    I have never seen chkdsk prompt the user for a y or n. Are you running any switches with chkdsk (/f perhaps)?

    -K


  3. #3
    Join Date
    Mar 2000
    Location
    Arizona, USA
    Posts
    493

    Re: This is for you DOS guru's (if there are any)

    This is under windows 2000. Here is the command line (or part of it)

    chkdsk c: /f /r

    Kris
    Software Engineer
    Phoenix,AZ
    Kris
    Software Engineer
    Phoenix, AZ USA

  4. #4
    Join Date
    Aug 2000
    Location
    KY
    Posts
    766

    Re: This is for you DOS guru's (if there are any)

    you will want to take advantage of file piping.
    Create a file that contains the Y answer like this
    copy con Y.txt
    y
    (press ctl Z) to write the file

    When you run chkdsk run it like this chkdsk <Y.txt


  5. #5
    Join Date
    Mar 2000
    Location
    Arizona, USA
    Posts
    493

    Re: This is for you DOS guru's (if there are any)

    Thanks I will give it a try

    Kris
    Software Engineer
    Phoenix,AZ
    Kris
    Software Engineer
    Phoenix, AZ USA

  6. #6
    Join Date
    Mar 2000
    Location
    Arizona, USA
    Posts
    493

    Re: This is for you DOS guru's (if there are any)

    Worked Like A Charm!!! Thanks!

    Kris
    Software Engineer
    Phoenix,AZ
    Kris
    Software Engineer
    Phoenix, AZ USA

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured