[英]CMD Username variable
there is a folder "Folder1" in有一个文件夹“Folder1”
%SYSTEMDRIVE%/users/[username]/appdata/local/Folder/Folder1/
Which is in the user's folders.这是在用户的文件夹中。 User names are unknown.用户名未知。
@Echo Off
Set Folder1=%SYSTEMDRIVE%/users/[username]/appdata/local/Folder/Folder1/Folder2/
IF EXIST Lotus (
move %SYSTEMDRIVE%/users/[username]/appdata/local/Folder/Folder1/ %SYSTEMDRIVE%/users/[username]/appdata//local/
) ELSE (
goto end
)
How to set username
?如何设置username
?
If the folder names are known/static, you can get by with something as simple as:如果文件夹名称是已知/静态的,您可以使用以下简单的方法:
for /d %%A in (%SYSTEMDRIVE%\Users\*) do (
if exist "%%A\appdata\local\Folder\Folder1\Lotus" (
move "%%A\appdata\local\Folder\Folder1\" "%%A\appdata\local\"
)
)
for /d
will just loop through the folders specified without being recursive. for /d
将只循环遍历指定的文件夹而不会递归。 I'm not sure about how you have your if
stuff setup but if you're aiming to grab user profiles, this is a simple way to do that.我不确定您是如何设置if
内容的,但如果您的目标是获取用户个人资料,这是一种简单的方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.