我的代码是:
cd "%UserProfile%\Desktop\Post-Install\Icon Config Files\"
move /y "Games\desktop.ini" "%UserProfile%\Games"
move /y "Music\desktop.ini" "%UserProfile%\Music"
move /y "Personal Docs\desktop.ini" "%UserProfile%\Personal Docs"
move /y "Pictures\desktop.ini" "%UserProfile%\Pictures"
move /y "Software\desktop.ini" "%UserProfile%\Software"
move /y "User\desktop.ini" "%UserProfile%"
move /y "Videos\desktop.ini" "%UserProfile%\Videos"
taskkill /f /im explorer.exe
start explorer.exe
但是,每次我运行它,它告诉我“系统找不到指定的文件”。我能做些什么来完成这项工作?
desktop.ini文件被隐藏,这就是move
命令无法找到它们的原因。因此,在每次移动之前,使用attrib -s -h "Games\desktop.ini"
删除隐藏(和系统,它必须是两者)属性,并在每次移动后使用attrib +s +h "%UserProfile%\Games\desktop.ini"
恢复这些属性