中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 02:26
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » How can a batch file handle a path containing \??\ ??
Printable Version  907 / 0
Floor1 yuan53770 Posted 2010-09-26 17:42
初级用户 Posts 40 Credits 67
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.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023