Skip to content

Instantly share code, notes, and snippets.

@eggist77
eggist77 / vbs_logger.vbs
Last active March 24, 2024 10:38
[vbs]logger 'test' dim log set log = new Logger log.setName("") log.setLogpath("") log.error "test error message" log.warning "test warning message" log.info "test info message"
class Logger
'------------------------------------------------------
'@ description : Logger
'@ auther : t.n
'@ version : 1.0
'@ since : 2020.4.4
'@ update : 2020.4.4
'------------------------------------------------------
private fso
@eggist77
eggist77 / VBS_FileExists_FolderExists.vbs
Last active March 24, 2024 10:32
[vbs]Check if file/folder exists
Dim filePath
Dim folderPath
Set fso = CreateObject("Scripting.FileSystemObject")
If fso.FileExists(filePath) then
'あるよ
Else
'ないよ
@eggist77
eggist77 / procGet.vbs
Last active March 24, 2024 10:29
[vbs] Get process information
Option Explicit
' variable declaration
Dim svcs
Dim procList
Dim proc
Dim msg
' Process List Get
Set svcs = WScript.CreateObject("WbemScripting.SWbemLocator").ConnectServer
@eggist77
eggist77 / getFileList.vbs
Last active March 24, 2024 10:28
[vbs] get list of files
Set fso = CreateObject("Scripting.FileSystemObject")
folderPath = "."
getFileList fso.getFolder(folderPath)
sub getFileList(ByVal folder)
for each subFolder in folder.subfolders
WScript.Echo "d," & subFolder.name & "," & subFolder.size & "," & subFolder.ParentFolder
'Write to a text file
'iomode
Const ForReading = 1, ForWriting = 2, ForAppending = 8
txtFile = "txtfile.txt"
Set fso = WScript.CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile(txtFile, ForAppending, True)
@eggist77
eggist77 / getFilePathDlgExcel.vbs
Last active December 24, 2022 01:47
hatena: 1593831099
Function getFilePathDlgExcel()
Dim excel
Set excel = CreateObject("Excel.Application")
buf = excel.GetOpenFilename("Text File,*.txt,All,*.*",1,"ファイルを選択して下さい","開く",false)
If buf <> False Then
getFilePathDlgExcel = buf
Else
WScript.Quit
End If
@eggist77
eggist77 / getFilePathDlgIE.vbs
Last active December 24, 2022 01:46
hatena: 1593831099
Function getFilePathDlgIE()
Dim ie
Set ie = WScript.CreateObject("InternetExplorer.Application")
ie.Navigate "about:blank"
Do While ie.Busy = True And ie.ReadyState <> 4 'READYSTATE_COMPLETE = 4
WScript.Sleep 100
Loop
ie.document.write "<html><body><input type='file' id='selectFileDialog'></body></html>"
ie.document.getElementById("selectFileDialog").click
@eggist77
eggist77 / get_program_list.ps1
Last active May 28, 2022 04:45
powershell Get a list of installed applications
$CurrentDir = Split-Path $MyInvocation.MyCommand.Path
# 1
Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* |
Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
Export-csv -path $CurrentDir"\ProgramList1.csv" -Encoding Default -NoTypeInformation
# 2
Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\* |
Select-Object DisplayName, DisplayVersion, Publisher, InstallDate |
Sub formatCondition()
Dim r As Range
Dim formatCondition As FormatCondition
'範囲設定
Set r = Range("A1:A5")
'条件付き書式の追加
Set formatCondition = r.FormatConditions.Add(Type:=xlTextString, String:="OK", TextOperator:=xlContains)
@eggist77
eggist77 / __vbs_get_ini_lib.md
Last active August 11, 2021 02:41
vbs: get_ini_lib.vbs

code: VBScript
description: VBScriptでINIファイルの読み書きをできるようにする