Help - Search - Members - Calendar
Full Version: chkdsk.cmd not scanning
The CD Forum > Bart's PE Builder > Plugins
rwaddell
Hello,

I am having a problem with chkdsk. It seems to be configured properly and the cmd file runs, but nothing is scanned.
I enter in the options and instantly I get the message
chkdsk.cmd: Check disk done...
Press any key to continue......

It appears that chkdsk.exe is not able run for some reason. Starting it from the command line doesn't work either.

Any suggestions would be appreciated. I have had great luck with other plugins and configuring them, but for some reason this one should be the easiest and its turning out to be the most difficult.

Thank you for your help
Robert

The files below are
Chkdsk.inf
chkdsk.cmd - original from bart
chkdsk2nd.cmd - a modified copy found on the web - same results

*********************
; chkdsk.inf
; PE Builder v3 plug-in INF file for chkdsk.exe
; Created by Bart Lagerweij

[Version]
Signature= "$Windows NT$"

[PEBuilder]
Name="Check Disk (chkdsk.exe)"
Enable=1
Help="chkdsk.htm"

[SourceDisksFiles]
chkdsk.exe=2
chkdsk.cmd=2,,1
chkdsk2nd.cmd=2,,1

[Append]
nu2menu.xml, chkdsk_nu2menu.xml
**********************************
**********************************
; chkdsk.cmd
@echo off
rem chkdsk.cmd
rem Created by Bart Lagerweij
setlocal
echo CHKDSK.CMD: Starting...
echo.
set _drive=
set _r=
set _f=
echo Please enter the drive, mount point or volume name to check (for example "c:")...
set /p _drive=Enter drive:
if "%_drive%" == "" goto _end
echo.
echo Do you want to fix errors on the disk *and*
echo locate bad sectors and recover readable information (Yes/No)...
:_recinp
set /p _r=Enter "y" or "n":
if "%_r%" == "" goto _recinp
if /I "%_r%" == "y" goto _go
if /I "%_r%" == "n" goto _fix
goto _recinp
:_fix
echo.
echo Do you want to fix errors on the disk (Yes/No)...
:_fixinp
set /p _f=Enter "y" or "n":
if /I "%_f%" == "" goto _fixinp
if /I "%_f%" == "y" goto _go
if /I "%_f%" == "n" goto _go
goto _recinp
:_go
echo.
echo ----------------------------------------------------------------
echo You have specified to check drive/volume %_drive%
echo.
echo With the following options:
if /I "%_r%" == "y" goto _pfix
if /I "%_f%" == "y" goto _pfix
goto _nofix
:_pfix
echo - Fix errors on the disk
:_nofix
if /I "%_r%" == "y" echo - Locate bad sectors and recover readable information (slow!)
echo ----------------------------------------------------------------
echo.
echo Start check disk? (Yes/No)...
:_startinp
set /p _s=Enter "y" or "n":
if /I "%_s%" == "" goto _startinp
if /I "%_s%" == "y" goto _run
if /I "%_s%" == "n" goto _abort
goto _startinp
:_run
if /I "%_f%" == "y" set _param=/f
if /I "%_r%" == "y" set _param=/r
set _param=%_drive% %_param%
echo Running: chkdsk.exe %_param%
chkdsk.exe %_param%
echo.
echo CHKDSK.CMD: Check disk done...
goto _end
:_abort
echo.
echo CHKDSK.CMD: Aborted...
:_end
pause
endlocal
**********************************
**********************************
@echo off
:: chkdsk.cmd
:: Created by Bart Lagerweij
:: Modified by Benny Pedersen, http://home1.stofanet.dk/photo
:: Replace the existing file "chkdsk.cmd" in this folder: ...plugin/chkdsk
setlocal
echo CHKDSK.CMD: Starting...
set _drv=
set _r=
set _f=
set _param=
echo.
set /p _drv=Check Disk. Enter drive letter:
if "%_drv%" == "" goto _end
for %%0 in (A B C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if /I "%_drv%" == "%%0" set _drv=%%0:
:_recInp
echo.
echo Do you want to fix errors on the disk *and*
echo locate bad sectors and recover readable information (Yes/No)...
:_recInp_loop
set /p _r=Enter1 "y" or "n":
if /I "%_r%" == "y" goto _go
if /I "%_r%" == "n" goto _fixInp
goto _recInp_loop
:_fixInp
echo.
echo Do you want to fix errors on the disk (Yes/No)...
:_fixInp_loop
set /p _f=Enter2 "y" or "n":
for %%0 in (y n) do if /I "%_f%" == "%%0" goto _go
goto _fixInp_loop
:_go
echo.
echo -------------------------------------------------------
echo You have specified to check drive/volume (%_drv%)
if /I not "%_f%" == "n" echo With the following options:
echo.
for %%0 in (%_f% %_r%) do if /I "%%0" == "y" echo. Fix errors on the disk.
if /I "%_r%" == "y" echo. Locate bad sectors and recover readable information.
echo -------------------------------------------------------
if /I "%_f%" == "y" set _param=/f
if /I "%_r%" == "y" set _param=/r
echo.
echo Ready to run: chkdsk.exe %_drv% %_param%
echo Press Ctrl+Break to cancel, or any key to continue...
pause > nul
chkdsk.exe %_drv% %_param%
echo.
echo CHKDSK.CMD: done...
pause
:_end
endlocal

**********************************
mbarnes
Hi rwaddell

One problem which often occurs is that plugins depend on other plugins and this is not stated clearly. (I am sure the original chkdsk provided by Bart with Bart PE will work as it will have been tested by many people)

There is a better alternative to the cmd files front ends to chkdsk and format etc, a GUI which looks like the Microsoft product is easier to use.

A number of plugins assume some dlls are registered, some Explorer plugins register several dll's they need as part of the registry in the plugin.inf


I used Chris Hall's chkdsk_GUI today, I also found that in A43 and right clicking on a drive letter then properties then tools I got to chkdsk. (as in real Windows). This may well depend on other plugins such as those below.


regards

Mike Barnes

details follow

QUOTE
PE Builder v3 plugin
Chkdsk-GUI

A GUI front end to Microsoft's command line check disk program. The GUI passes the settings selected within the GUI and then launches the command line disk checker in the normal way, using the correct switches.

The GUI is written using AutoIt v3.1.0 - this is NOT required for the plugin to run.

All files (over and above those on the original Windows CD) are contained in the plugin - no additonal dowloads required.
Chkdsk-GUI plugin for PE Builder © Chris Hall 2005
PE Builder Copyright © 2002-2003 Bart Lagerweij. All rights reserved.
Windows Chkdsk disk checker © 2001 Microsoft Corporation



autorun_regdll.cmd
CODE
rem registered by Explorer plugin or autorun_regdll.cmd
start /wait regsvr32 /s /i %windir%\system32\shell32.dll
start /wait regsvr32 /s %windir%\system32\mlang.dll
start /wait regsvr32 /s /i %windir%\system32\browseui.dll
start /wait regsvr32 /s %windir%\system32\msxml.dll
start /wait regsvr32 /s /i %windir%\system32\mshtml.dll
start /wait regsvr32 /s /i %windir%\system32\shdocvw.dll
exit
rwaddell
Thank you for the reply Mbarnes,

I checked what you said and it also gave me an idea to try a different NT version.
I created a bartPE disk with XP sp2 and the basic bartPE setup and it chkdsk worked first try.

I need to be able to create the disk with 2003 server SP1 in order to be able to PXE boot the repair disk.

Is there a reason why using the 2003 server SP1 cd would differ from the XP sp2? or a reason from PXE booting the image?

Thanks again for your help.

Robert


BTW: pxe booting bartPE can be found at
http://www.911cd.net/forums/index.php?showtopic=9685&st=0
mbarnes
Bart PE was originally designed & tested for XP SP1 and SP2, there are some changes which need to be made with Win 2003 & Win 2003 SP1, try searching on 2003 for further information

If you look at some recent plugins they have different registry settings for XP & 2003

regards
Mike Barnes
stuartr
QUOTE (rwaddell @ Dec 8 2005, 09:13 PM)
Thank you for the reply Mbarnes,

I checked what you said and it also gave me an idea to try a different NT version.
I created a bartPE disk with XP sp2 and the basic bartPE setup and it chkdsk worked first try.

I need to be able to create the disk with 2003 server SP1 in order to be able to PXE boot the repair disk. 

Is there a reason why using the 2003 server SP1 cd would differ from the XP sp2?  or a reason from PXE booting the image?

Thanks again for your help.

Robert
BTW: pxe booting bartPE can be found at
http://www.911cd.net/forums/index.php?showtopic=9685&st=0
*


Here's the list of things I've done to the W2K3 SP1 standard distribution to allow it to work properly with BartPE:

1) File hivecls.inf edited to consolidate multiple [Strings] Sections
2) SETUPDD.SY_ replaced by SETUPDD.SYS (hotfix release 903085)
3) DISKPART.EX_ replaced by DISKPART.EXE (RTM)
rwaddell
Stuartr, Can you be more specific on what you had to change.
In the hivecls.inf file I see the section on Strings, but what needs to be changed. or, what should it look like.

*********** hivecls.inf
[Strings]
FilePathMSHTA="%SystemRoot%\system32\mshta.exe"
***********

for the setupdd.sys files, I have two different versions. One from SP1 and the other from a running 2003 server with all the patches.
setupdd.sys
5.2.3970.0 = file size 422kb
5.2.3970.1830 = file size 450kb

diskpart.exe
5.2.3970.0 = file size 162kb
5.2.3970.1830 = file size 174kb


Does anyone have chkdsk working with a bartPE 2003 sp1 cd or image?

our goal is to have a pxe boot image with virus scan, adware, ghost, network share, and disk utilities. Currently everything works except for chkdsk.

Thanks very much for your help
Robert
stuartr
QUOTE (rwaddell @ Dec 9 2005, 03:43 PM)
Stuartr,  Can you be more specific on what you had to change.
In the hivecls.inf file I see the section on Strings, but what needs to be changed.  or, what should it look like. 

*********** hivecls.inf
[Strings]
FilePathMSHTA="%SystemRoot%\system32\mshta.exe"
***********

for the setupdd.sys files, I have two different versions.  One from SP1 and the other from a running 2003 server with all the patches.
setupdd.sys
5.2.3970.0 = file size 422kb
5.2.3970.1830 = file size 450kb

diskpart.exe
5.2.3970.0 = file size 162kb
5.2.3970.1830 = file size 174kb
Does anyone have chkdsk working with a bartPE 2003 sp1 cd or image? 

our goal is to have a pxe boot image with virus scan, adware, ghost, network share, and disk utilities.  Currently everything works except for chkdsk.

Thanks very much for your help
Robert
*


There are multiple (2) String sections in hivecls.inf. Move the contents of the smaller one into the larger one and remove the now-empty section.

The Setupdd.sys file I referenced is from a POST-SP1 hotfix. It affects diskpart drive creation and I don't know that it's required. I just added it for good measure.

You need to use the .0 version (RTM) of diskpart.exe

Yes, I have chkdsk working fine under a BartPE build with W2K3 Sp1.
rwaddell
Stuartr,

I have now found both sections of the hivecls.inf
I ended up not looking down far enough in the file.

After changing the hivecls.inf to have both "strings" sections it still didn't work.

I don't know what could be causing this not to work.

the slipstreamed copy of 2003 server sp1 appears to be fine. I installed it on a fresh box just to be sure. Everything worked including chkdsk.exe

I re-downloaded both versions of bartpe zip and exe (I know it shouldn't matter) and built an image on the 2003 server using the cd it was installed from.
Chkdsk still didn't work
I built an image using 2003 server without sp1 and chkdsk worked.
Then I went back to the SP1 and edited the hivecls.inf file, created another iso and still had the same results.

I have been unsuccessful at following your instructions
2) SETUPDD.SY_ replaced by SETUPDD.SYS (hotfix release 903085)
I thought I had the right version, but apparently not. I have done some more reading on MS website and others and have been unsuccessful in locating the correct version.
Would you be able to send me the hot fix? I can get it from MS but it may take several days. I don't see a place to download it...

Thanks again for your help.

Robert
rwaddell@qlenexa.com
rwaddell
stuatr,

I have had a little bit of progress but I am still not close to solving this.

I found a post you did on diskpart and changing the dcomlauch.inf to have
[SetupReg.AddReg.3790]

Now diskpart.exe works, but I still can't use chkdsk.

Is there something else that needs to be added or changed?


I was able to get Microsoft to send me the hotfix you mentioned. So that is copied over but appeared to have no effect. It may have helped diskpart to work? I don't know

The ISO image I am using can be compressed to less than 70mb and posted on my web server if that would help anyone troubleshoot this issue.


Thank you,

Robert
rwaddell
Success!

In my latest image chkdsk and diskpart are both working.

I am going to start over now and then I will post what exactly I did do in order for it to work.

Estimated time - sometime today.


Thanks very much for everyone's help. The forum's have been great!
rwaddell
It's working - Success! Thanks for everyone’s help.

I now have a working BartPE image using 2003 server sp1 that is PXE booting from my TFTP server with all the needed programs.

Best of all - diskpart and chkdsk are working. I was mainly interested in chkdsk because after a blue screen - chkdsk is much more helpful.
But, reading up on diskpart lead me to the chkdsk fix I used.

I did the following and now the image is working, - This has been repeated twice to verify it.

1) copy the contents of windows 2003 server sp1 cd to a local folder. This will be the source.
2) Using a fresh install of BartsPE builder 3.1.3 - edited and enabled the plugin
" RpcSS needs to launch DComLaunch Service first"
It should now read
[SetupReg.AddReg.3790]
; W2k3 SP1 Only

3) Find and edit hivecls.inf to combine the two [Strings] sections into one. See below for more details.
4) Delete the SP1 versions of the following six files and replace them with pre sp1 versions. (version 5.2.3790.0)
chkdsk diskpart ifsutil ufat ulib untfs
More details are below.
5) Create the image and chkdsk and diskpart should both be working.


I have added more details just in case - I know I always appreciate having too many deails than not enough. smile.gif

#2 details
From - http://www.911cd.net/forums//index.php?showtopic=12072&hl=
Thanks to "goldfinger"
****************
All I had to do was to modify the build number in the enabled dcomlauch.inf file.
After this change the Remote Procedure Call (RPCSS) service will start.

Before:
[SetupReg.AddReg.2600]
; XP SP2 Only

Now:
[SetupReg.AddReg.3790]
; W2k3 SP1 Only
****************

#3 details
Thanks to "Stuartr" from his posts from this topic.
Edited the hivecls.inf file to have both sections of [Strings] combined.

In short take the following section and add it to the [Strings] section located below it in the file. You may need to scroll a bit. (I did)
[Strings]
FilePathMSHTA="%SystemRoot%\system32\mshta.exe"

Afterwards there should only be one [Strings] section in the hivecls.inf file. In the Strings section it should contain the following.

CODE
*section of hivecls.inf*
EXECUTABLE_FILES="Executable Files"
FILE_FOLDER="File Folder"
FILE_SYSTEM_ATTRIBUTES="File system attributes"
FilePathMSHTA="%SystemRoot%\system32\mshta.exe"
FOLDER="Folder"
FOLDER_REDIRECTION_EDITOR="Folder Redirection Editor"
FONT_FILE="Font file"
FONTS="Fonts"
GCCPL_DEFAULT="Game Controllers CPL Shell Extension Default Property Sheets"


#4 details
Thanks to "Lasse" for the idea

After reading - http://www.911cd.net/forums//index.php?sho...server+2003+sp1
and then
http://www.sysinternals.com/SourceCode/fmifs.html

I deleted the following compressed files - from the I386 directory I am building from
chkdsk.ex_ diskpart.ex_ ifsutil.dl_ ufat.dl_ ulib.dl_ untfs.dl_
and then replaced them with the uncompressed versions from the windows 2003 server cd without the service pack. That makes all the files version 5.2.3790.0
(note - to uncompress the files that end with "_" open them with winrar or winzip)
It was probably overkill to copy all those files, but I wasn't exactly sure what files would help or hurt. They are all related to chkdsk so I figured it couldn't hurt.



That’s it. After doing the following I now have the Bart PE version I needed. I don't know if unforeseen troubles will come up from replacing the files, but I hope not.


Thank you very much to everyone! The information on the forums has been wonderful.

ps: Let me know if you had similar problems and/or if this information helped. Lots of people are reading this post - I just hope it is doing some good!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.