中国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-09-15 11:51
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS批处理 & 脚本技术(批处理室) » How to apply long file names in batch files
Printable Version  2,428 / 8
Floor1 martin325 Posted 2006-02-22 19:59
银牌会员 Posts 603 Credits 1,582
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.
Floor2 llm Posted 2006-02-22 22:10
元老会员 Posts 294 Credits 840
“Temporary Internet Files”
Floor3 martin325 Posted 2006-02-22 22:12
银牌会员 Posts 603 Credits 1,582
Okay, thank you. In a batch file, when deleting files, how to automatically answer "yes" as the confirmation for the delete command
Floor4 chujiafu Posted 2006-02-23 06:56
银牌会员 Posts 595 Credits 1,339 From 安徽 宿州
Try echo.|del the file name you want to delete.
Floor5 martin325 Posted 2006-02-23 08:53
银牌会员 Posts 603 Credits 1,582
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.
Floor6 无奈何 Posted 2006-02-23 20:20
荣誉版主 Posts 356 Credits 1,338
Try replacing it with the following statement.

echo y|del .
Floor7 martin325 Posted 2006-02-24 01:25
银牌会员 Posts 603 Credits 1,582
It worked, thank you friend from floor 6
Floor8 namejm Posted 2006-04-17 23:33
荣誉版主 Posts 1,737 Credits 5,226 From 成都
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.
Floor9 xjmxjm1234 Posted 2006-04-18 16:56
中级用户 Posts 166 Credits 361
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".
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023