2017-04-04 195 views
-7

我有一个从Google下载的文件(位于下载文件夹中) ,我想将它移动到自动运行文件夹(计算机打开时文件运行的文件夹)。使用cmd移动文件?

我需要使用cmd命令(这是为什么它要使用USB橡皮鸭来完成。 我使用Windows 10的64位,如果它是任何帮助的原因移动文件。

的文件所在的路径是

C:\Users\%USERPROFILE%\Downloads\Test.exe 

,我想将它移动到是

C:\Users\%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup 

原因的路径,为什么%USERPROFILE%是它SHO所有计算机都工作。

+2

[tag:rubberduck]标签与此无关。请在使用前阅读标签说明。 –

+0

有一个“移动”命令... – SomethingDark

+1

为什么一般的解决方案可以在所有计算机上将最近下载的文件移动到自动运行的声音,如恶意软件/病毒? – abelenky

回答

-1

要移动文件,请使用move命令。

move "C:\Users\%USERPROFILE%\Downloads\Test.exe" "C:\Users\%USERPROFILE%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup" 

我把引号的源和目标的情况下,你是这些人谁拥有自己的用户名空间出于某种原因(和目标需要他们,无论如何,在“开始菜单”的空间)之一。

move /?输出:

Moves files and renames files and directories. 

To move one or more files: 
MOVE [/Y | /-Y] [drive:][path]filename1[,...] destination 

    [drive:][path]filename1 Specifies the location and name of the file 
          or files you want to move. 
    destination    Specifies the new location of the file. Destination 
          can consist of a drive letter and colon, a 
          directory name, or a combination. If you are moving 
          only one file, you can also include a filename if 
          you want to rename the file when you move it. 
    [drive:][path]dirname1 Specifies the directory you want to rename. 
    dirname2    Specifies the new name of the directory. 

    /Y      Suppresses prompting to confirm you want to 
          overwrite an existing destination file. 
    /-Y      Causes prompting to confirm you want to overwrite 
          an existing destination file. 
+0

感谢它的工作 –

+1

不知道为什么我被downvoted,但没关系... – SomethingDark

-2

要移动文件使用MV,但不工作,如果你不使用管理员,你如何可以入侵,尝试超级用户工具的Windows!

+0

*我是英文noob * – ramyres110

+1

Windows没有命令'mv'(除了作为PowerShell中的别名)。这个问题被标记为vbscript和批处理文件。 –

0

尝试使用的%username%代替%userprofile%