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-07-31 19:14
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » How to apply long file names in batch files View 2,252 Replies 8
Original Poster Posted 2006-02-22 19:59 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 1,582
Posts 603
Joined 2006-02-20 20:26
20-year member
UID 50690
Status Offline
The folder name in your D drive is "Temporary Internet Files". In a batch file running on Windows XP, to refer to this folder correctly, you can use the following way:

```batch
@echo off
del /s /q D:\Temporary^ Internet^ Files\*.*
```

Here, the spaces in the folder name need to be escaped with the caret (^) character so that the batch file can correctly identify the folder path.
Floor 2 Posted 2006-02-22 22:10 ·  中国 北京 丰台区 联通
元老会员
★★
Credits 840
Posts 294
Joined 2003-09-27 00:00
22-year member
UID 10424
Gender Male
Status Offline
“Temporary Internet Files”
Floor 3 Posted 2006-02-22 22:12 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 1,582
Posts 603
Joined 2006-02-20 20:26
20-year member
UID 50690
Status Offline
Okay, thank you. In a batch file, when deleting files, how to automatically answer "yes" as the confirmation for the delete command
Floor 4 Posted 2006-02-23 06:56 ·  中国 安徽 宿州 泗县 电信
银牌会员
★★★
Credits 1,339
Posts 595
Joined 2004-05-26 00:00
22-year member
UID 25306
Gender Male
From 安徽 宿州
Status Offline
Try echo.|del the file name you want to delete.
Floor 5 Posted 2006-02-23 08:53 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 1,582
Posts 603
Joined 2006-02-20 20:26
20-year member
UID 50690
Status Offline
cd\
D:
cd "fggg"
echo.|del "*.*"

When written as above, after executing the batch processing, it doesn't work! It still asks for confirmation to delete, and you have to press "Y" or "N" to continue executing.
Floor 6 Posted 2006-02-23 20:20 ·  中国 辽宁 锦州 中移铁通
荣誉版主
★★★
Credits 1,338
Posts 356
Joined 2005-07-15 12:09
21-year member
UID 40733
Gender Male
Status Offline
Try replacing it with the following statement.

echo y|del .
  ☆开始\运行 (WIN+R)☆
%ComSpec% /cset,=何奈无── 。何奈可无是原,事奈无做人奈无&for,/l,%i,in,(22,-1,0)do,@call,set/p= %,:~%i,1%<nul&ping/n 1 127.1>nul

Floor 7 Posted 2006-02-24 01:25 ·  中国 浙江 杭州 电信
银牌会员
★★★
Credits 1,582
Posts 603
Joined 2006-02-20 20:26
20-year member
UID 50690
Status Offline
It worked, thank you friend from floor 6
Floor 8 Posted 2006-04-17 23:33 ·  中国 四川 成都 鹏博士宽带
荣誉版主
★★★★
batch fan
Credits 5,226
Posts 1,737
Joined 2006-03-10 00:38
20-year member
UID 51697
From 成都
Status Offline
Originally posted by martin325 at 2006-2-23 08:53:
cd\
D:
cd "fggg"
echo.|del "*.*"

According to the above writing, after executing the batch processing, it doesn't work! It still asks for confirmation to delete, and only continues to execute after pressing "Y" or "N"

In XP, the Del command already has the /q silent delete mode switch, directly adding /q is more concise.
Floor 9 Posted 2006-04-18 16:56 ·  中国 上海 徐汇区 电信
中级用户
★★
论坛第一菜鸟
Credits 361
Posts 166
Joined 2006-04-15 13:23
20-year member
UID 53870
Status Offline
Originally posted by martin325 at 2006-2-22 07:59 PM:
There is a folder named "Temporary Internet Files" in my D drive. Now I want to make a batch file that runs in the WINXP system to delete all the files in this folder. May I ask how to express...

What is being asked is how to represent it!
If there are no other folders starting with "Tempor", it should be "Tempor~1".
Diskette Operating System
Forum Jump: