I used the following batch file
-----------------------------------------------------------------------------------------------------
@echo off
rem Use the reg command to read the registry and get the path as a path variable
for /f "tokens=2*" %%a in ('REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMDrive" /v ImagePath^|findstr "ImagePath"') do (
set MyPath=%%b
)
echo %MyPath%
pause
------------------------------------------------------------------------------------------------------
and got this result: \??\C:\WINDOWS\system32\drivers\WMDrive.sys
Among it, I want to use the path \??\C:\WINDOWS\system32\drivers as the path for the md5 check in the batch file below
-------------------------------------------------------------------------------------------------------
@echo off
title=md5sum
echo ************************************
echo This program is used for md5sum verification
echo ************************************
echo.
set site=C:\WINDOWS\system32\drivers
cd /d %site%
for /f "delims=" %%a in ('dir /b /od %site%') do set WMDrive.sys=%%a
if "%WMDrive.sys%"=="" goto eof
md5sum %WMDrive.sys%
goto theend
:eof
echo There is no file in location: %site%
:theend
echo. &pause
-------------------------------------------------------------------------------------------------------
I wonder if that can be done?
In other words, if these two batch files are combined and run together, how can I make the second batch file use the path obtained by the first one? Since the path contains characters like \??\, I don't understand how to modify it.
Hope any brothers who know can help, thanks.
-----------------------------------------------------------------------------------------------------
@echo off
rem Use the reg command to read the registry and get the path as a path variable
for /f "tokens=2*" %%a in ('REG QUERY "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WMDrive" /v ImagePath^|findstr "ImagePath"') do (
set MyPath=%%b
)
echo %MyPath%
pause
------------------------------------------------------------------------------------------------------
and got this result: \??\C:\WINDOWS\system32\drivers\WMDrive.sys
Among it, I want to use the path \??\C:\WINDOWS\system32\drivers as the path for the md5 check in the batch file below
-------------------------------------------------------------------------------------------------------
@echo off
title=md5sum
echo ************************************
echo This program is used for md5sum verification
echo ************************************
echo.
set site=C:\WINDOWS\system32\drivers
cd /d %site%
for /f "delims=" %%a in ('dir /b /od %site%') do set WMDrive.sys=%%a
if "%WMDrive.sys%"=="" goto eof
md5sum %WMDrive.sys%
goto theend
:eof
echo There is no file in location: %site%
:theend
echo. &pause
-------------------------------------------------------------------------------------------------------
I wonder if that can be done?
In other words, if these two batch files are combined and run together, how can I make the second batch file use the path obtained by the first one? Since the path contains characters like \??\, I don't understand how to modify it.
Hope any brothers who know can help, thanks.
