A. When you run Check Disk (CHKDSK) or AutoChk on a partition on which
NT is installed you may receive one of the following messages
- Cannot lock volume for direct access
- Cannot open volume for direct access
This can be caused by a 3rd party application locking the partition such as a
virus checker or disk monitor tool. To correct disable any 3rd party services or
devices that may be locking the partition.
- Start the Services control panel applet (Start - Settings - Control Panel
- Services)
- Select the service and click Startup
- Set the startup type to Manual and click OK
- Repeat for any other services
- Start the Devices control panel applet (Start - Settings - Control Panel -
Devices)
- Set the startup type to disabled for any 3rd-party devices who you think
might be causing the lock problem but BE CAREFUL. If you are unsure the
device you are disabling may stop system startup create a second hardware
profile and test (see 'Q. How can I safely disable a device?').
- Restart the machine, the drive should no longer be locked
@echo off
rem File: Chk_Disk.bat
rem Use: WinXP
rem Synopsis:
rem Chkdsk.exe will not run from the command-line becuase it thinks the
rem volume is mounted and there are file conflicts. So best to restart in order
rem for it to run. This also forces all running applications to be unloaded.
rem chkdsk
rem /f = Fix Issues Found
rem /v = Display Cleanup Info for NTFS Volumes
rem /r = Find bad sectors
echo y | chkdsk /f /v /r
rem shutdown
rem -r = Restart after shutdown
rem -f = Force shutdown of any running programs
rem -t = Forces shutdown in # of seconds shown (5 here)
shutdown -r -f -t 5
Tom Oliphint June 08, 2004