Skip to content

Instantly share code, notes, and snippets.

@stuncloud
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuncloud/1efa66a8fdba6e51f976 to your computer and use it in GitHub Desktop.
Save stuncloud/1efa66a8fdba6e51f976 to your computer and use it in GitHub Desktop.
uwsファイルをuwsc.exeに関連付ける
// https://gist.github.com/stuncloud/9660072
call Module_UAC.uws
UAC.Elevate()
uwsc_path = GET_UWSC_DIR + "\UWSC.exe"
if msgbox(uwsc_path + "<#CR>に.uwsファイルを関連付けますか?", BTN_YES or BTN_NO) = BTN_YES then
PathQuoteSpacesA(uwsc_path)
with CreateOleObj("WScript.Shell")
.RegWrite("HKCR\.uws\", "UWSC")
.RegWrite("HKCR\UWSC\EditFlags", $0, "REG_DWORD")
.RegWrite("HKCR\UWSC\BrowserFlags", $8, "REG_DWORD")
.RegWrite("HKCR\UWSC\shell\", "open")
.RegWrite("HKCR\UWSC\shell\open\command\", uwsc_path + " <#DBL>%1<#DBL> %*")
if GET_UWSC_PRO then
// Pro版はデバッガも関連付ける
udebug_path = GET_UWSC_DIR + "\UDebug.exe"
PathQuoteSpacesA(udebug_path)
.RegWrite("HKCR\UWSC\shell\debug\command\", udebug_path + " <#DBL>%1<#DBL>")
endif
endwith
endif
// 必要であればダブルクォートで括る
def_dll PathQuoteSpacesA(var String):BOOL:ShlwApi.DLL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment