最も簡単な .vbs

  OS で通常使用可能なオブジェクトを作成



いきなりコードを書いても動きますが、いろいろやっていくうちに必要になるので先頭に書いておきます

' ***********************************************************
' 標準的なオブジェクトを作成
' ***********************************************************
Set WshShell	= CreateObject( "WScript.Shell" )
Set Fso		= CreateObject( "Scripting.FileSystemObject" )
Set Dic		= CreateObject( "Scripting.Dictionary" )
Set Shell		= CreateObject( "Shell.Application" )

Set Cn		= CreateObject( "ADODB.Connection" )
Set Rs		= CreateObject( "ADODB.Recordset" )
Set Stream	= CreateObject( "ADODB.Stream" )
Set Adox		= CreateObject( "ADOX.Catalog" )

' ***********************************************************
' 処理開始
' ***********************************************************


以下込み入った作業用

' ***********************************************************
' 標準的なオブジェクト
' ***********************************************************
Set WshShell = CreateObject( "WScript.Shell" )
Set Fso = CreateObject( "Scripting.FileSystemObject" )
Set Dic = CreateObject( "Scripting.Dictionary" )
Set Shell = CreateObject( "Shell.Application" )

' ***********************************************************
' 比較的標準的なオブジェクト
' ***********************************************************
Set Cn = CreateObject( "ADODB.Connection" )
Set Rs = CreateObject( "ADODB.Recordset" )
Set Stream = CreateObject( "ADODB.Stream" )
Set Adox = CreateObject( "ADOX.Catalog" )


' ***********************************************************
' 用途別
' ***********************************************************
// メール送信
Set Cdo = Server.CreateObject("CDO.Message")
// WMI ( 通常 )
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2") 
// IE
Set Ie = CreateObject("InternetExplorer.Application")
// XP 以降
Set objDialog = CreateObject("UserAccounts.CommonDialog")
// GUID 取得
Set TypeLib = CreateObject("Scriptlet.TypeLib")

' ***********************************************************
' インストール必要
' ***********************************************************
// Microsoft Excel
Set App = CreateObject("Excel.Application")
// Basp21 
Set Basp = CreateObject( "Basp21" )


' ***********************************************************
' BatchHelper オブジェクト ( lightbox )
' ***********************************************************
Set BatchHelper = CreateObject( "Lbox.BatchHelper" )
Set Fsystem = CreateObject( "Lbox.Fsystem" )
Set Database = CreateObject( "Lbox.Database" )
Set Prt = CreateObject( "Lbox.Prt" ) 
Set Wnet = CreateObject( "Lbox.Wnet" ) 
Set Ftp = CreateObject( "Lbox.Ftp" )
Set Win = CreateObject( "Lbox.Window" )
Set Outer = CreateObject( "Lbox.OuterDll" ) 
// スクリプトで記述された COM ( Windows Script Component )
Set Wsc = CreateObject( "Lbox.BatchWsc" ) 



' ***********************************************************
' 処理開始
' ***********************************************************














  infoboard   管理者用   
このエントリーをはてなブックマークに追加





フリーフォントWEBサービス
SQLの窓WEBサービス

SQLの窓フリーソフト

素材

一般WEBツールリンク

SQLの窓

フリーソフト

JSライブラリ