2016-05-12 54 views
-2

我一直在輸入一個簡單的腳本,但我需要它自己複製到啓動文件夾。然而,文件夾的路徑中有空格,我試過引用它和雙引號,但沒有任何工作。這個腳本有什麼問題?使.vbs腳本複製到啓動文件夾,Windows 2000

FileSystemObject.CopyFile "C:\Documents and Settings\keemstar\Desktop\dolpo.vbs", """C:\Documents and Settings"\keemstar\Start Menu\Programs\Startup" 

請注意,這是不是最後的,因爲它已被編輯了很多次。我甚至不確定這是否是正確的命令,但消息人士說。 我知道這是一個愚蠢的問題,但如果有人能幫忙,我會喜歡它。

+0

你檢查的位置>「」「C:\ Documents和設置」 \ keemstar \啓動菜單\程序\啓動「 –

+0

」Keemstar「哈哈。 –

回答

0

嘗試使用Shell.Application而不是FSO

CreateObject("Shell.Application").Namespace(7).CopyHere WScript.ScriptFullName, 4 + 16 + 1024 
0

根據我的經驗,使用FileSystemObject對象的功能的CopyFile複製文件導致了不同的結果。

每當我需要複製使用VBScript文件,我通常選擇運行Windows拷貝命令:

set wshShell = CreateObject("Wscript.Shell") 

sSourceFile = "C:\Documents and Settings\keemstar\Desktop\dolpo.vbs" 
sTargetFolder = "C:\Documents and Settings\keemstar\Start Menu\Programs\Startup" 

sCmd = "%comspec% /c copy """ & sSourceFile & """ """ & sTargetFolder & """ /Y" 

wshShell.Run sCmd, 0, True 
相關問題