'* ================================================================== '* GodMode のショートカットを作成しますYO! 'http://www10.plala.or.jp/palm84/wsh.html 'http://d.hatena.ne.jp/palm84/20130502/1367497725 'http://www10.plala.or.jp/palm84/archives/wsh/Windows_CreateGodMode.vbs.txt 'https://eu7w9wsmf6a74xyjdfzl3q-on.drv.tw/archives/wsh/Windows_CreateGodMode.vbs.txt '* ================================================================== 'Option Explicit 'On Error Resume Next 'Shell オブジェクトを作成 Set objShell = WScript.CreateObject("WScript.Shell") 'FileSystemObject オブジェクトを作成 Set objFSO = WScript.CreateObject("Scripting.FileSystemObject") Const ForReading = 1, ForWriting = 2, ForAppending = 8 Const INIFile = "desktop.ini" '*** 環境変数とか取得 *** QuickLaunch = objShell.ExpandEnvironmentStrings("%APPDATA%\Microsoft\Internet Explorer\Quick Launch") Desktop = objShell.SpecialFolders("Desktop") MyKakunin '*** GodMode *** Title = "GodMode" strFolder = QuickLaunch & "\" & Title strCLSID = "{ED7BA470-8E54-465E-825C-99712043E01C}" strIcon = "%SystemRoot%\system32\SHELL32.dll, 207" MyCreateFolder '*** デスクトップのショートカット *** strShortCut = Desktop & "\" & Title & ".lnk" MySC '*** クイック起動のショートカット *** strShortCut = QuickLaunch & "\" & Title & ".lnk" MySC MsgBox "「GodMode フォルダ」のショートカットを" & vbcrlf & "デスクトップとクイック起動に作成しました YO!" , 64 ,"(´・ω・`) クマー! " Set objTxt = Nothing Set objFile = Nothing Set objFolder = Nothing Set objFSO = Nothing Set objShell = Nothing '********************************************************* '* Sub MyKakunin '********************************************************* Sub MyKakunin Kakunin = MsgBox ("GodMode のショートカットを作りますのん? (´・ω・`)", 65 ,"GodMode のショートカットを作るYO! (´・ω・`) ") If Kakunin = 2 Then WScript.Quit End If End Sub '********************************************************* '* Sub MyCreateFolder '********************************************************* Sub MyCreateFolder 'フォルダが存在するなら何もしない、なければ作成 If Not objFSO.FolderExists(strFolder) Then objFSO.CreateFolder strFolder Else MsgBox "「GodMode フォルダ」はもうありますYO! (´・ω・`)" , 48 , "クマー (´・ω・`)" Wscript.Quit End If ' desktop.ini 作成 strINI = strFolder & "\" & INIFile Set objTxt = objFSO.OpenTextFile(strINI, ForWriting, true, -2) objTxt.WriteLine "[.ShellClassInfo]" objTxt.WriteLine "CLSID=" & strCLSID objTxt.Close 'ファイルにシステム・隠し属性 Set objFile = objFSO.GetFile(strINI) objFile.Attributes = objFile.Attributes + 6 'フォルダ属性 Set objFolder = objFSO.GetFolder(strFolder) 'フォルダにシステム属性 'objFolder.Attributes = objFolder.Attributes + 4 'フォルダにシステム&隠し属性 objFolder.Attributes = objFolder.Attributes + 6 End Sub '********************************************************* '* Sub MySC '********************************************************* Sub MySC '*** ショートカットオブジェクトを作成 *** Set objShortCut = objShell.CreateShortcut(strShortCut) '*** .lnk ファイルを作成 *** With objShortCut ' リンク先 .TargetPath = "%windir%\explorer.exe" ' 作業フォルダ .WorkingDirectory = "" ' 引数 .Arguments = "/root, " & strFolder ' コメント .Description = "" ' アイコン .IconLocation = strIcon End With objShortCut.Save End Sub