1、1. rem 创建以点结尾的文件夹 2. md “C:test“ 3. md “C:testbatcher“ 复制代码 1. rem 把以点结尾的文件夹重命名为普通文件夹 2. rem 短文件名可以使用 dir/x 命令获得 3. ren “C:testBATCHE1“ “batcher“ 复制代码 1. rem 把普通文件夹重命名为以点结尾的文件夹 2. ren “C:testbatcher“ “batcher/“ 复制代码 1. rem 打开以点结尾的文件夹 2. start “ “C:testbatcher“ 复制代码 1. rem 进入以点结尾的文件夹 2. rem 短文件名可以使用
2、dir/x 命令获得 3. cd “C:testNEW1“ 复制代码 1. rem 向以点结尾的文件夹中复制文件 2. copy “C:testa.txt“ “C:testbatcher“ 复制代码 1. rem 删除以点结尾的文件夹中的文件 2. rem 短文件名可以使用 dir/x 命令获得 3. del /a /f /q “C:testNEW1a.txt“ 复制代码 1. rem 修改以点结尾的文件夹的属性为“隐藏” 2. echo off 3. set DstFolder=C:testbatcher. 4. “%temp%FolderProperty.vbs“ echo Set obj
3、FSO = CreateObject(“Scripting.FileSystemObject“).GetFolder(“?%DstFolder%.“) 5. “%temp%FolderProperty.vbs“ echo objFSO.Attributes=objFSO.Attributes+2 6. cscript /nologo “%temp%FolderProperty.vbs“ 复制代码 1. rem 删除以点结尾的文件夹 2. rd /s /q “C:testbatcher“ 复制代码 【方案二】以空格结尾的文件夹 1. 基本操作与方案一大致相同,此处不再赘述。 复制代码 【方案三】
4、系统保留字文件夹(Con, Prn, Aux, Nul, Lpt1, Com1, Com2) 1. rem 创建系统保留字文件夹 2. md “C:testbatcher“ 3. md “C:testbatchercon“ 复制代码 1. rem 打开系统保留字文件夹 2. start “ “C:testbatchercon“ 复制代码 1. rem 向系统保留字文件夹中复制文件 2. copy “C:testbatchera.txt“ “C:testbatchercon“ 复制代码 1. rem 删除系统保留字文件夹中的文件 2. del /a /f /q “C:testbatchercon
5、a.txt“ 复制代码 1. rem 修改系统保留字文件夹的属性为“隐藏” 2. echo off 3. set DstFolder=C:testbatchercon 4. “%temp%FolderProperty.vbs“ echo Set objFSO = CreateObject(“Scripting.FileSystemObject“).GetFolder(“?%DstFolder%.“) 5. “%temp%FolderProperty.vbs“ echo objFSO.Attributes=objFSO.Attributes+2 6. cscript /nologo “%temp
6、%FolderProperty.vbs“ 复制代码 1. rem 删除系统保留字文件夹 2. rd /s /q “C:testbatchercon“ 复制代码 【方案四】特殊字符文件夹(, /, :, *, ?, “, , |) 1. rem 创建特殊字符文件夹 2. echo off 3. set “DstFolder=C:testbatcherA“ 4. if exist “%DstFolder%“ ( 5. echo 文件夹%DstFolder%已存在 6. goto :eof 7. ) 8. md “%DstFolder%“ 9. “%DstFolder%desktop.ini“ ec
7、ho .ShellClassInfo 10. “%DstFolder%desktop.ini“ echo LocalizedResourceName=BatHome,-1 11. attrib +s +h “%DstFolder%desktop.ini“ 12. %temp%UnlockReg.txt echo HKEY_CURRENT_USERSoftwareMicrosoftWindowsShellLocalizedResourceName 9 13. regini %temp%UnlockReg.txt 14. %temp%LockReg.txt echo HKEY_CURRENT_US
8、ERSoftwareMicrosoftWindowsShellLocalizedResourceName 8 15. %temp%LockReg.txt echo “BatHome,-1“ = REG_SZ “|“ 16. regini %temp%LockReg.txt 17. attrib +s “%DstFolder%“ 复制代码 1. rem 创建无法直接删除的特殊字符文件夹 2. echo off 3. set “DstFolder=C:testbatcherB“ 4. if exist “%DstFolder%“ ( 5. rem echo y|cacls “?%DstFolder
9、%nul“ /g everyone:f 6. rem attrib -r -a -s -h “?%DstFolder%nul“ 7. rem del /a /f /q “?%DstFolder%nul“ 8. echo 文件夹%DstFolder%已存在 9. goto :eof 10. ) 11. md “%DstFolder%“ 12. “%DstFolder%desktop.ini“ echo .ShellClassInfo 13. “%DstFolder%desktop.ini“ echo LocalizedResourceName=BatHome,-1 14. attrib +s +
10、h “%DstFolder%desktop.ini“ 15. “?%DstFolder%nul“ echo. 16. attrib +s +h “%DstFolder%desktop.ini“ 17. %temp%UnlockReg.txt echo HKEY_CURRENT_USERSoftwareMicrosoftWindowsShellLocalizedResourceName 9 18. regini %temp%UnlockReg.txt 19. %temp%LockReg.txt echo HKEY_CURRENT_USERSoftwareMicrosoftWindowsShell
11、LocalizedResourceName 8 20. %temp%LockReg.txt echo “BatHome,-1“ = REG_SZ “|“ 21. regini %temp%LockReg.txt 22. attrib +r +a +s +h “?%DstFolder%nul“ 23. echo y|cacls “?%DstFolder%nul“ /d everyonenul 24. attrib +s +r “%DstFolder%“ 复制代码 【方案五】以点结尾的文件 1. rem 创建以点结尾的文件 2. md “C:test“ 3. echo “?C:testbatche
12、r.“ 复制代码 1. rem 打开以点结尾的文件 2. notepad “?C:testbatcher.“ 复制代码 1. rem 复制以点结尾的文件 2. copy “?C:testbatcher.“ “?C:“ 复制代码 1. rem 修改以点结尾的文件的属性为“隐藏” 2. echo off 3. set DstFile=C:testbatcher. 4. “%temp%FileProperty.vbs“ echo Set objFSO = CreateObject(“Scripting.FileSystemObject“).GetFile(“?%DstFile%.“) 5. “%te
13、mp%FileProperty.vbs“ echo objFSO.Attributes=objFSO.Attributes+2 6. cscript /nologo “%temp%FileProperty.vbs“ 复制代码 1. rem 删除以点结尾的文件 2. del /a /f /q “?C:testbatcher.“ 复制代码 【方案六】系统保留字文件(Con, Prn, Aux, Nul, Lpt1, Com1, Com2) 1. rem 创建系统保留字文件 2. md “C:testbatcher“ 3. echo “?C:testbatchercon“ 复制代码 1. rem 打
14、开系统保留字文件 2. notepad “?C:testbatchercon“ 复制代码 1. rem 复制系统保留字文件 2. copy “?C:testbatchercon“ “?C:test“ 复制代码 1. rem 修改系统保留字文件的属性为“隐藏” 2. echo off 3. set DstFile=C:testbatchercon 4. “%temp%FileProperty.vbs“ echo Set objFSO = CreateObject(“Scripting.FileSystemObject“).GetFile(“?%DstFile%.“) 5. “%temp%FileProperty.vbs“ echo objFSO.Attributes=objFSO.Attributes+2 6. cscript /nologo “%temp%FileProperty.vbs“ 复制代码 1. rem 删除系统保留字文件 2. del /a /f /q “?C:testbatchercon“ 复制代码