Last active
February 10, 2021 12:54
-
-
Save eggist77/a35cf8f6a39df6e95c1954f0bd8e67f9 to your computer and use it in GitHub Desktop.
hatena: entry/20200411/1586561707
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
Dim fso | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
'1.Get ScriptFile folder | |
MsgBox fso.getParentFolderName(WScript.ScriptFullName) | |
'2.C:\Windows\System32 | |
MsgBox fso.getParentFolderName("C:\Windows\System32\notepad.exe") | |
'3.notepad.exe | |
MsgBox fso.GetFileName("C:\Windows\System32\notepad.exe") | |
'4 C:\Windows\System32 | |
MsgBox fso.GetFile("C:\Windows\System32\notepad.exe").ParentFolder | |
'5 notepad | |
MsgBox fso.GetBaseName("C:\Windows\System32\notepad.exe") | |
'6 exe | |
MsgBox fso.GetExtensionName("C:\Windows\System32\notepad.exe") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment