Skip to content

Commit

Permalink
Fix UpdateSendTo
Browse files Browse the repository at this point in the history
  • Loading branch information
goreliu committed Apr 28, 2016
1 parent 4a88bbf commit 8f75b52
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions RunZ.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -1774,29 +1774,8 @@ UpdateSendTo(create = true, overwrite = false)
return
}

; 注意引号和空格!
fileContent := "var RunZCmdTool = ""\"""
fileContent .= StrReplace(A_ScriptDir, "\", "\\") "\\RunZ.exe\"" "
fileContent .= " \""" . StrReplace(A_ScriptDir, "\", "\\") . "\\Core\\RunZCmdTool.ahk\"" ""`n"

jsText =
(
var ws = new ActiveXObject("WScript.Shell")

var arg = ""
for (var i = 0; i < WScript.Arguments.Count(); i++)
{
arg += " \"" + WScript.Arguments(i) + "\" "
}

ws.Run(RunZCmdTool + arg)
)
fileContent .= jsText

FileDelete, % A_ScriptDir "\Core\SendToRunZ.js"
FileAppend, % fileContent, % A_ScriptDir "\Core\SendToRunZ.js", CP936
FileCreateShortcut, % A_ScriptDir "\Core\SendToRunZ.js", % A_ScriptDir "\Core\SendToRunZ.lnk"
, , , 发送到 RunZ, % A_ScriptDir "\RunZ.ico"
FileCreateShortcut, % A_ScriptDir "\RunZ.exe", % A_ScriptDir "\Core\SendToRunZ.lnk"
, , "%A_ScriptDir%\Core\RunZCmdTool.ahk", 发送到 RunZ, % A_ScriptDir "\RunZ.ico"
FileCopy, % A_ScriptDir "\Core\SendToRunZ.lnk"
, % StrReplace(A_StartMenu, "\Start Menu", "\SendTo\") "RunZ.lnk", 1
}
Expand Down

0 comments on commit 8f75b52

Please sign in to comment.