Skip to content

Instantly share code, notes, and snippets.

@eggist77
eggist77 / shortcutadd.vbs
Last active February 24, 2019 00:17
[VBS]ショートカットを作成する
Option Explicit
'variable declaration
Dim crDir, f, line, ary, fName
Dim fso, wsh
Set fso = CreateObject("Scripting.FileSystemObject")
Set wsh = CreateObject("WScript.Shell")
メモ帳,%windir%\System32\notepad.exe
@eggist77
eggist77 / textRead.vbs
Created March 22, 2019 13:02
textRead
'test
'Read 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, ForReading)
'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)
' ---------------------------------------------------
' description:
' auther: name
' version: 1.0
' since: yyyy/mm/dd
' update: yyyy/mm/dd
' ---------------------------------------------------
Option Explicit
@eggist77
eggist77 / telnet.ttl
Last active April 10, 2019 13:28
telnet.ttl
;------------------------------------------------------
; @description : telnet for CentOS
; @auther : n
; @version : 1.0
; @since : 2019/4/9
; @update : 2019/4/9
;------------------------------------------------------
target='192.168.0.1'
username='user'
;autocmd.ttl
macroname = 'autocmd'
cmdlist = 'cmdlist.txt'
prompt1 = '$'
prompt2 = '#'
timeout = 15
;コマンドリストチェック
filesearch cmdlist
@eggist77
eggist77 / ssh.ttl
Last active November 12, 2019 12:23
;------------------------------------------------------
; @description : ssh for CentOS
; @auther : n
; @version : 1.1
; @since : 2019/4/9
; @update : 2019/11/12
;------------------------------------------------------
target='192.168.0.1'
username='user'
@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 / pathGet.vbs
Last active February 10, 2021 12:54
hatena: entry/20200411/1586561707
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