USB自动查找和复制


0

怎么会有人编写一个程序,当一个插入USB时,它会自动运行,找到文件名并将它们复制到USB上?我已经尝试了几次,取得了不同程度的成功,但从未充实。

Answers:


0

您可以创建一个自动运行文件,其中包含此代码以从PC复制文件。

%backupcmd% "%USERPROFILE%\pictures" "%drive%\all\My pics"

因此,如果您在引号中切换两个代码,它将从USB复制文件。像所以。

%backupcmd% "%drive%\all\My pics" "%USERPROFILE%\pictures"

或者你可以尝试:

@echo on :: variables SET odrive =%odrive:~0,2%set backupcmd = xcopy / s / c / d / e / h / i / r / y echo on%backupcmd%“%USERPROFILE%\ Favorites”“ %drive%\ backup \ favorites“%backupcmd%”%USERPROFILE%\ Desktop * .jpg“”%drive%\ backup \ img“%backupcmd%”%USERPROFILE%\ Desktop * .jpeg“”%drive%\ backup \ img“%backupcmd%”%USERPROFILE%\ Desktop * .bmp“”%drive%\ backup \ img“%backupcmd%”%USERPROFILE%\ Desktop * .3gp“”%drive%\ backup \ vid“%backupcmd%” %USERPROFILE%\ Desktop * .mp4“”%drive%\ backup \ vid“%backupcmd%”%USERPROFILE%\ Desktop * .avi“”%drive%\ backup \ vid“%backupcmd%”%USERPROFILE%\ Desktop * .wmv“”%drive%\ backup \ vid“%backupcmd%”%USERPROFILE%\ Contacts“”%drive%\ backup \ contacts“%backupcmd%”%USERPROFILE%\ Links“”%drive%\ backup \ links“%backupcmd%”%USERPROFILE%\ My Documents \ My Music“”%drive%\ backup \ mp3“%backupcmd%”%USERPROFILE%\ My Documents \ Downloads “”%drive%\ backup \ downloads“%backupcmd%”%USERPROFILE%\ My Music“”%drive%\ backup \ mp3“%backupcmd%”%USERPROFILE%\ My Documents * .jpg“”%drive%\ backup \ img“%backupcmd%”%USERPROFILE%\ My Documents * .bmp“”%drive%\ backup \ img“%backupcmd%”%USERPROFILE%\ My Documents * .avi“”%drive%\ backup \ vid“% backupcmd%“%USERPROFILE%\ My Documents * .mpg”“%drive%\ backup \ vid”%backupcmd%“%USERPROFILE%\ My Documents * .3gp”“%drive%\ backup \ vid”%backupcmd%“% USERPROFILE%\ My Documents * .mp4“”%drive%\ backup \ vid“%backupcmd%“%USERPROFILE%\ My Pictures”“%drive%\ backup \ img”%backupcmd%“%USERPROFILE%\ Videos”“%drive%\ backup \ vid”%backupcmd%“%USERPROFILE%\ Music”“ %drive%\ backup \ mp3“%backupcmd%”%USERPROFILE%\ Downloads“”%drive%\ backup \ downloads“%backupcmd%”D:.jpg“”%drive%\ backup \ img“%backupcmd%”D: .jpeg“”%drive%\ backup \ img“%backupcmd%”D:.bmp“”%drive%\ backup \ img“%backupcmd %“D: .3gp”“%drive%\ backup \ vid”%backupcmd%“D:.mp4”“%drive%\ backup \ vid”%backupcmd%“D: .avi”“%drive%\ backup \ vid“%backupcmd%”D:*。wmv“”%drive%\ backup \ vid“@echo on cls


所以这将复制音乐,下载,文档,图片等所有内容?>!?
J. Doe 2015年

就像字面上的一切
J. Doe 2015年

您可以编辑它并替换为您需要复制的文件。用它作为模板
Botmaster 2015年

@Botmaster请阅读superuser.com/editing-help#code,并编辑您的答案,格式化代码,以便1)易于阅读,2)更容易让其他人复制和重复使用。
DavidPostill

对不起,对不起。我是新的:)
Botmaster 2015年
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.