2017-04-04 196 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%