I want to make a self running batch file that will allow me to run chkdsk /r without having the user press y and ENTER to confirm the checking on system startup.
so far I have the batch file set to launch the chkdsk /r command as an admin using
set "params=%*"
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
chkdsk /r
what can i add to this to get the press y and then the enter key to complete this with no user interaction
im doing a large scale pc refreshing and i want to email each user this bat file and run it after they all have it on their desktop
and how could i send a restart command so the pc will auto restart
so far I have the batch file set to launch the chkdsk /r command as an admin using
set "params=%*"
cd /d "%~dp0" && ( if exist "%temp%\getadmin.vbs" del "%temp%\getadmin.vbs" ) && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%temp%\getadmin.vbs" && "%temp%\getadmin.vbs" && exit /B )
chkdsk /r
what can i add to this to get the press y and then the enter key to complete this with no user interaction
im doing a large scale pc refreshing and i want to email each user this bat file and run it after they all have it on their desktop
and how could i send a restart command so the pc will auto restart
Last edited: