Last active
February 24, 2019 00:17
-
-
Save eggist77/9116f25f0c34894aa32d8d1c81c199d4 to your computer and use it in GitHub Desktop.
[VBS]ショートカットを作成する
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Option Explicit | |
'variable declaration | |
Dim crDir, f, line, ary, fName | |
Dim fso, wsh | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set wsh = CreateObject("WScript.Shell") | |
crDir = fso.getParentFolderName(WScript.ScriptFullName) | |
Set f = fso.OpenTextFile(crDir & "\sclist.txt", 1) | |
Do Until f.AtEndOfStream | |
line = f.ReadLine | |
ary = Split(line, ",") | |
Call shortCutAdd(ary(0),ary(1)) | |
Loop | |
f.Close | |
Sub shortCutAdd(scname,exePath) | |
Dim shortCutFile | |
fName = crDir & "\" & scname & ".lnk" | |
Set shortCutFile = wsh.CreateShortcut(fName) | |
shortCutFile.TargetPath = exePath | |
shortCutFile.Save | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment