China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-08 23:12
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » The meaning of \\?\%1 is: The \\?\ is a prefix used in the Windows long path syntax. It allows paths longer than the traditional 260 - character limit. %1 is a placeholder for the first command - line argument passed to the batch script. So overall, this part is used to represent a path that can potentially be a long path and is taking the first argument as that path for the `rd /s/q` (remove directory / silent / quiet) operation. View 5,469 Replies 16
Original Poster Posted 2008-06-01 01:13 ·  中国 天津 联通
初级用户
★★
Credits 173
Posts 69
Joined 2007-08-07 22:40
19-year member
UID 94807
Gender Male
Status Offline
What does \\?\%1 mean at the end?
-------------------------------------------------------------------
The following two lines of commands are commands in two batch files, which are used to delete files.
rd /s/q \\?\%1
del /f/a/q \\?\%1
--------------------------------
Please advise, what does \\?\%1 mean at the end?
Floor 2 Posted 2008-06-01 01:37 ·  中国 湖南 株洲 电信
金牌会员
★★★★
永远的学习者
Credits 3,105
Posts 1,276
Joined 2008-03-08 13:00
18-year member
UID 112398
Gender Male
Status Offline
\\?\ refers to any path
%1 is the file you want to delete
批处理之家新域名:www.bathome.net
Floor 3 Posted 2008-06-01 10:56 ·  中国 上海 联通
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Originally posted by zw19750516 at 2008-6-1 01:37 AM:
\\?\ refers to any path
%1 is the file you want to delete

Can you introduce the difference between the two:
rd /s/q \\?\%1
rd /s/q %1
Floor 4 Posted 2008-06-01 11:01 ·  中国 广东 广州 移动
初级用户
Credits 70
Posts 36
Joined 2008-05-21 22:48
18-year member
UID 119349
Gender Male
Status Offline
rd /s/q \\?\%1 This is similar to format..
rd /s/q %1 This deletes the directory of %1
Floor 5 Posted 2008-06-01 11:10 ·  中国 江苏 扬州 电信
高级用户
★★★
Credits 620
Posts 329
Joined 2007-12-05 15:34
18-year member
UID 104754
Gender Male
Status Offline
This command is really powerful........

Deleting files is relatively fast........
Floor 6 Posted 2008-06-01 11:15 ·  中国 上海 联通
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
Originally posted by andison625 at 2008-6-1 11:01 AM:
rd /s/q \\?\%1 This seems similar to format..
rd /s/q %1 This deletes the directory of %1

But I really can't see where it is similar to format. Can you explain it?
@echo off
echo rd /s/q \\?\%1
echo rd /s/q %1
pause

Floor 7 Posted 2008-06-01 11:30 ·  中国 广东 广州 移动
初级用户
Credits 70
Posts 36
Joined 2008-05-21 22:48
18-year member
UID 119349
Gender Male
Status Offline
Swe sweat......

rd /s/q seems to be deleting the specified folder

? If it refers to all folders under the root directory?

rs /s/q \\?\ Is it the same as format?
Floor 8 Posted 2008-06-01 14:18 ·  中国 天津 联通
初级用户
★★
Credits 173
Posts 69
Joined 2007-08-07 22:40
19-year member
UID 94807
Gender Male
Status Offline
Can you introduce the difference between the two:

rd /s/q \\?\%1

rd /s/q %1

-------------------------------

What is the difference between \\?\%1 and %1?
Floor 9 Posted 2008-06-01 18:53 ·  中国 山东 济南 联通
高级用户
★★★
Credits 959
Posts 474
Joined 2007-10-25 10:40
18-year member
UID 100716
Gender Male
Status Offline
Can anyone explain in detail the meaning of all the commands??
Floor 10 Posted 2008-06-01 19:26 ·  中国 广西 南宁 电信
中级用户
★★
丶杏灬丶
Credits 280
Posts 105
Joined 2008-05-06 03:37
18-year member
UID 117858
Gender Male
From 广西
Status Offline
Can't delete anything at all.....
Still can rd /S /Q %1

[ Last edited by joyn on 2008-6-1 at 07:28 PM ]
Floor 11 Posted 2008-06-01 23:15 ·  中国 四川 自贡 联通
新手上路
Credits 10
Posts 5
Joined 2008-05-30 16:26
18-year member
UID 120110
Gender Male
Status Offline
Hehe, new users can't understand very well
Floor 12 Posted 2008-06-02 08:08 ·  中国 天津 联通
初级用户
★★
Credits 173
Posts 69
Joined 2007-08-07 22:40
19-year member
UID 94807
Gender Male
Status Offline
Still don't understand, could the elder explain it?
Floor 13 Posted 2008-06-02 13:56 ·  中国 广东 广州 电信
初级用户
Credits 48
Posts 27
Joined 2008-06-01 23:43
18-year member
UID 120310
Gender Male
Status Offline
I don't understand, still don't understand, is there no professional person to explain it?
Floor 14 Posted 2008-06-02 14:41 ·  中国 山东 淄博 联通
银牌会员
★★★
Credits 1,604
Posts 646
Joined 2008-04-13 23:39
18-year member
UID 115804
Gender Male
Status Offline
%1 The first parameter of the batch processing %2 The second parameter
Create a new batch processing named 1.bat
net user %1 %2 /add
Then open CMD and enter 1.bat 1234 123
Then a user with username 1234 and password 123 is created~
I think this is the most straightforward explanation~
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
ggyy66 +2 2008-06-02 17:29
心绪平和,眼藏静谧,无比安稳的火... Purification of soul...Just a false...^_^
Floor 15 Posted 2008-06-02 17:29 ·  中国 天津 联通
初级用户
★★
Credits 173
Posts 69
Joined 2007-08-07 22:40
19-year member
UID 94807
Gender Male
Status Offline
What does \\?\ mean?
Forum Jump: