ソース掲示板




すべてから検索

キーワード   条件 表示 現行ログ 過去ログ トピックス 名前 本文
スクリプト オンライン (1)
日時: 2018/01/28 01:17
名前: lightbox



▼ ※ 使用上の注意

その場で実行するか、ダウンロードして実行するか自由ですが、本ソフトを使用した結果については、一切責任を負えせんのでご了承ください。
テンプレート
拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )
Call laylaLoadFunction( "wmiReg.vbs" )




</SCRIPT>
</JOB>
メンテナンス

エクスプローラのディレクトリで右クリックした時のメニューにディレクトリを開くコマンドを追加 ( No.1 )
日時: 2018/01/28 01:18
名前: lightbox


日時: 2018/01/28 01:18
名前: lightbox
主にスタートメニューから右クリックで使用します

http://winofsql.jp/wsf/registOpenDir.wsf

拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )
Call laylaLoadFunction( "wmiReg.vbs" )

' ***********************************************************
' Cscript.exe で強制実行
' ***********************************************************
Crun

' **********************************************************
' タイトル入力
' **********************************************************
strTitle = InputBox( "タイトルを入力して下さい" , "WEB WSH", "ユーザーディレクトリ" )
if Trim( strTitle ) = "" then
	Wscript.Quit
end if

' **********************************************************
' 対象ディレクトリ
' **********************************************************
target = SelectDir( "対象フォルダを選択して下さい" )
if target = "" then
	Wscript.Quit
end if

' **********************************************************
' レジストリ
' **********************************************************
strPath = "Directory\shell\opendir\command"
Call WMIRegCreateKey( HKEY_CLASSES_ROOT, strPath )
strValue = "explorer.exe /e," & Dd( target )
Call WMIRegSetStringValue( HKEY_CLASSES_ROOT, strPath, Empty, strValue )
strPath = "Directory\shell\opendir"
Call WMIRegSetStringValue( HKEY_CLASSES_ROOT, strPath, Empty, strTitle )


</SCRIPT>
</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
IE のソースエディタを登録 ( No.2 )
日時: 2018/01/28 01:22
名前: lightbox
http://winofsql.jp/wsf/ieSrcEditor.wsf

拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )
Call laylaLoadFunction( "wmiReg.vbs" )
Call laylaLoadFunction( "toolFunction.vbs" )

' **********************************************************
' エディタ選択
' **********************************************************
strValue = OpenFileName
if strValue = "" then
	Wscript.Quit
end if

' **********************************************************
' レジストリ
' **********************************************************
strPath = "SOFTWARE\Microsoft\Internet Explorer\View Source Editor\Editor Name"
Call WMIRegCreateKey( HKEY_LOCAL_MACHINE, strPath )
strValue = Dd( strValue )
Call WMIRegSetStringValue( HKEY_LOCAL_MACHINE, strPath, Empty, strValue )

MsgOk( strValue & " を IE のソースエディタとして登録しました" )

</SCRIPT>
</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
共有一覧 ( No.3 )
日時: 2018/01/28 01:25
名前: lightbox
http://winofsql.jp/wsf/enumShareWMI.wsf

拡張子:
<JOB>
<COMMENT>
************************************************************
 WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )

Crun

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
	& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colShares = objWMIService.ExecQuery("Select * from Win32_Share")
Wscript.Echo "【共有一覧】"
Wscript.Echo "----------------------------------------------------"
For Each Share In colShares
	Wscript.Echo Rpad(Share.Name, " ", 20) & " : " & Share.Path
Next
Wscript.Echo

</SCRIPT>
</JOB>
【XP以降】 http://winofsql.jp/wsf/enumShare.wsf
拡張子:
<JOB>
<COMMENT>
************************************************************
 WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )

Crun

Set Fs = GetObject("WinNT://" & GetCpname & "/LanmanServer")

Wscript.Echo "【共有一覧】"
Wscript.Echo "----------------------------------------------------"
For Each Share In Fs
	Wscript.Echo Rpad(Share.Name, " ", 20) & " : " & Share.Path
Next
Wscript.Echo

</SCRIPT>
</JOB>
【削除と追加】( 追加は簡単なほうで ) ※ 但し追加はXP以降
拡張子:
<JOB>
<COMMENT>
************************************************************
 WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )

Crun

' 削除
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
	& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colShares = objWMIService.ExecQuery("Select * from Win32_Share")
For Each objShare in colShares
	If objShare.Name = "共有名" Then
		objShare.Delete
	End If
Next

Set Fs = GetObject("WinNT://" & GetCpname & "/LanmanServer")

' 追加( 同じ名前だとエラー )
Set objShare = Fs.Create("FileShare","共有名")
objShare.Path = "C:\TEMP\excel"
on error resume next
objShare.SetInfo
If Err.number <> 0 Then
	MsgBox("共有作成に失敗しました")
End if
on error goto 0

</SCRIPT>
</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
ディレクトリ内のディレクトリサイズ一覧 ( No.4 )
日時: 2018/01/28 01:27
名前: lightbox
http://winofsql.jp/wsf/folder_size.wsf

拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )

' ***********************************************************
' Cscript.exe で強制実行
' ***********************************************************
Crun

' **********************************************************
' 対象ディレクトリ
' **********************************************************
target = SelectDir( "対象フォルダを選択して下さい" )
if target = "" then
	Wscript.Quit
end if

' **********************************************************
' ファイルシステムオブジェクト
' **********************************************************
GetFso

' **********************************************************
' フォルダオブジェクト取得
' **********************************************************
Set objFolder =  Fso.GetFolder(target)

' **********************************************************
' サブフォルダコレクション取得
' **********************************************************
Set colSubFolder =  objFolder.SubFolders

' **********************************************************
' 一覧
' **********************************************************
For Each obj in colSubFolder

	on error resume next
	Wscript.Echo Lpad(FormatNumber((Fix(obj.Size / 1024) / 1024),3)," ", 15) & " M : " & obj.Name
	if Err.Number <> 0 then
		Wscript.Echo obj.Name & ":" & Err.Description
	end if
	on error goto 0

Next

</SCRIPT>
</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
OS の情報 ( No.5 )
日時: 2018/01/28 01:28
名前: lightbox
http://winofsql.jp/wsf/osInfo.wsf

拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )

' ***********************************************************
' Cscript.exe で強制実行
' ***********************************************************
Crun2 110

' **********************************************************
' 一覧( ローカル限定 )
' **********************************************************
Set obj = GetObject("winmgmts:\\.\root\cimv2")
Set colTarget = obj.ExecQuery( "select * from Win32_OperatingSystem" )
' この場合行は1行しかありません
For Each objRow in colTarget
	Set colProps = objRow.Properties_
	For Each objProp in colProps
		Wscript.Echo Rpad(objProp.Name," ", 25 ) & " : " & objProp.Value
	Next
Next

</SCRIPT>
</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
【PDFバージョン】ディレクトリ内のディレクトリサイズ一覧 ( No.6 )
日時: 2018/02/02 20:00
名前: lightbox
WSH から PHP を呼び出すサンプルです。

PHP は、php.exe にパスが通っている必要があります。
( php.ini の allow_url_include を On にして下さい )
php_com_dotnet.dll を有効にする必要があります

拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
 ★★★ PDF 作成 ★★★
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )

target = SelectDir( "対象フォルダを選択して下さい" )
if target = "" then
	Wscript.Quit
end if

strParam = "$DIR," & Replace( ScriptDir, "\", "\\" )
strParam = strParam & ",$TARGET," & Replace(target, "\", "\\")
Call RunPhpParam( "TargetList", False, strParam )

</SCRIPT>

<COMMENT>
************************************************************
 実行する PHP ( php.exe にパスが通っている必要があります )
 php5 でテストしています
 php.ini の allow_url_include を On にして下さい
************************************************************
</COMMENT>
<RESOURCE id="TargetList">
<![CDATA[
<?php
error_reporting(E_ALL & ~E_DEPRECATED);
require("https://lightbox.sakura.ne.jp/in/phppdf/japanese.txt");

$GLOBALS['margin'] = 5;

$pdf = new PDF_Japanese( 'P', 'mm', 'A4' );

$pdf->AddSJISFont("MSPGothic");
$pdf->AddPage();
# 塗りつぶす為の色
$pdf->SetFillColor( 200, 230, 185 );

# タイトル印字
$pdf->SetFont('SJIS','B',20);
$text = 'ディレクトリ容量の表示';
$pdf->Text( $GLOBALS['margin'], 13.5, $text );

# 通常印字フォント
$pdf->SetFont('SJIS','',10);
# ページ内の印字開始高さ
$pdf->Ln(10);

$Fso = new COM("Scripting.FileSystemObject");
$Folder = $Fso->GetFolder("$TARGET");
$SubFolder = $Folder->SubFolders;

$pdf->SetX( $GLOBALS['margin'] );
$pdf->SetTextColor( 0, 0, 255 );
$pdf->Cell( 100, 6, "ディレクトリ名称" , 1, 0, 'C', 1 );
$pdf->SetTextColor( 0, 0, 0 );
$pdf->Cell( 20, 6, "サイズ", 1, 0, 'C', 0 );
$pdf->Ln();

foreach($SubFolder as $obj) {

	$pdf->SetX( $GLOBALS['margin'] );
	$pdf->SetTextColor( 0, 0, 255 );
	$pdf->Cell( 100, 6, $obj->Name, 1, 0, 'L', 1 );
	$pdf->SetTextColor( 0, 0, 0 );

	try {
		$pdf->Cell( 20, 6, trim((floor($obj->Size / 1000) / 1000)), 1, 0, 'R', 0 );
	}
	catch( Exception $e ) {
		$pdf->Cell( 20, 6, "エラー", 1, 0, 'L', 1 );
	}

	$pdf->Ln();

}


$pdf->Output("$DIR\\sample.pdf");

# **********************************************************
# Windows 経由の 外部実行
# **********************************************************
$WshShell = new COM("WScript.Shell");
$command = "RunDLL32.EXE shell32.dll,ShellExec_RunDLL ";
$command .= "\"$DIR\\sample.pdf\"";
$WshShell->Run( $command, 1, TRUE );

print "処理が終了しました\n";

?>
]]>
</RESOURCE>

</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
サービス一覧 : スタートモードの表示 ( No.7 )
日時: 2018/01/28 01:29
名前: lightbox
http://winofsql.jp/wsf/enumChangeService.wsf

拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
 サービス一覧 : スタートモードの表示
 【 Auto, Manual, Disabled 】
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )

' ***********************************************************
' Cscript.exe で強制実行
' ***********************************************************
Crun2 110

' **********************************************************
' 一覧( ローカル限定 )
' **********************************************************
Set obj = GetObject("winmgmts:\\.\root\cimv2")
Set colTarget = obj.ExecQuery( "select * from Win32_Service" )

str = ""
For Each objRow in colTarget
	str = str & RpadB(objRow.Name," ",36)
	str = str & RpadB(objRow.DisplayName," ",60)
	str = str & RpadB(objRow.StartMode," ",8)

	Wscript.Echo str
	str = ""
Next

</SCRIPT>

<COMMENT>
uint32 Change(
  string DisplayName,
  string PathName,
  uint32 ServiceType,
  uint32 ErrorControl,
  string StartMode,
  boolean DesktopInteract,
  string StartName,
  string StartPassword,
  string LoadOrderGroup,
  string LoadOrderGroupDependencies,
  string ServiceDependencies
);
</COMMENT>

</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
Windows Update を無効・有効 ( No.8 )
日時: 2018/01/28 01:30
名前: lightbox
無効
http://winofsql.jp/wsf/disableWindowsUpdate.wsf

有効
http://winofsql.jp/wsf/enableWindowsUpdate.wsf


無効
拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
 Windows Update を無効にする
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )
Call laylaLoadFunction( "wmiService.vbs" )

' ***********************************************************
' Cscript.exe で強制実行
' ***********************************************************
Crun

str = WMIGetServiceName( "Automatic Updates" )
Wscript.Echo "サービス名 : " & str
WMIStopService( str )
Call WMIChangeStartMode( str, 2 )
Wscript.Echo "サービスを停止し、無効に設定しました"
</SCRIPT>

</JOB>
有効
拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
 Windows Update を有効にする
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )
Call laylaLoadFunction( "wmiService.vbs" )

' ***********************************************************
' Cscript.exe で強制実行
' ***********************************************************
Crun

str = WMIGetServiceName( "Automatic Updates" )
Wscript.Echo "サービス名 : " & str
Call WMIChangeStartMode( str, 0 )
WMIStartService( str )
Wscript.Echo "サービスを自動に設定して、開始しました"
</SCRIPT>

</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
デスクトップの列挙 ( No.9 )
日時: 2018/01/28 01:31
名前: lightbox
http://winofsql.jp/wsf/enumDesktop.wsf

拡張子:
<JOB>
<COMMENT>
************************************************************
 WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )

GetShell

Crun2 120

Wscript.Echo "【デスクトップ】"
Wscript.Echo "----------------------------------------------------"
Set objFolder = Shell.NameSpace( 0 )

Set objFolderItems = objFolder.Items()
nCount = objFolderItems.Count

' 列挙1
strData = ""
For i = 0 to nCount - 1

	strData = strData & RpadB(objFolderItems.Item(i).Name," ",30 )
'	strData = strData & RpadB(objFolderItems.Item(i).ModifyDate," ",30 )
	strData = strData & RpadB(objFolderItems.Item(i).Path," ",89 )
'	strData = strData & RpadB(objFolderItems.Item(i).Size," ",20 )
'	strData = strData & RpadB(objFolderItems.Item(i).Type," ",20 )
	WScript.Echo strData
	strData = ""

Next


' 列挙2
strData = ""
For Each obj In objFolderItems

	strData = strData & RpadB(objFolder.GetDetailsOf(obj, 0)," ",20 )
	strData = strData & RpadB(objFolder.GetDetailsOf(obj, 1)," ",20 )
	strData = strData & RpadB(objFolder.GetDetailsOf(obj, 2)," ",20 )
	strData = strData & RpadB(objFolder.GetDetailsOf(obj, 3)," ",20 )
	strData = strData & RpadB(objFolder.GetDetailsOf(obj, 4)," ",20 )
	strData = strData & RpadB(objFolder.GetDetailsOf(obj, -1)," ",20 )
	WScript.Echo strData
	strData = ""

Next

Wscript.Echo

</SCRIPT>
</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
テンプレート登録【HTML】 ( No.10 )
日時: 2018/02/02 17:44
名前: lightbox
http://winofsql.jp/wsf/newTemplate_layla001.wsf



作成されるコード↓
拡張子:
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
<TITLE>HTML テンプレート</TITLE>
<STYLE type="text/css">
* {
	font-family: "MS Pゴシック";
	font-size: 12px;
}
BODY {
	background-color: forestgreen;
	color: white;
}
</STYLE>
<LINK rel="stylesheet" type="text/css" href="style.css">
<SCRIPT 
	language="javascript"
	type="text/javascript"
	src="http://lightbox.in.coocan.jp/prototype.js">
</SCRIPT>
<SCRIPT language="javascript" type="text/javascript">

// *********************************************************
// 関数
// *********************************************************
function doAction( strValue ) {

	alert( strValue )

	return true;
}

</SCRIPT>
</HEAD>

<!-- *******************************************************
 BODY
******************************************************** -->
<BODY>

<!-- *******************************************************
 フォーム
******************************************************** -->
<FORM
	name="frmMain"
	method="GET"
>

<INPUT type="button" value="実行" onClick='doAction("引数");'>

</FORM>

</BODY>
</HTML>
WEB WSH(インストール) コード↓
拡張子:
<JOB>
<COMMENT>
************************************************************
 WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )

TargetPath = TemplateDir & "\layla001.tpl"
TeplateText = GetInline( "Template" )
Call PutTextFile( TargetPath, TeplateText )

TargetPath = TemplateDir & "\layla001.vbs"
VbsText = GetInline( "CopyTemplate" )
VbsText = Replace( VbsText, "$FROM", TemplateDir & "\layla001.tpl" )
Call PutTextFile( TargetPath, VbsText )

TargetPath = TempDir & "\layla001.reg"
ScriptPath = Replace( TemplateDir & "\layla001.vbs", "\", "\\" )
RegText = GetInline( "regData" )
RegText = Replace( RegText, "$SCRIPT", ScriptPath )
Call PutTextFileUnicode( TargetPath, RegText )

Call RunSync( "regedit.exe " & Dd(TargetPath) )

</SCRIPT>

<COMMENT>
************************************************************
 テンプレート
************************************************************
</COMMENT>
<RESOURCE id="Template">
<![CDATA[
<HTML>
<HEAD>
<META http-equiv="Content-type" content="text/html; charset=Shift_JIS">
<TITLE>HTML テンプレート</TITLE>
<STYLE type="text/css">
* {
	font-family: "MS Pゴシック";
	font-size: 12px;
}
BODY {
	background-color: forestgreen;
	color: white;
}
</STYLE>
<LINK rel="stylesheet" type="text/css" href="style.css">
<SCRIPT 
	language="javascript"
	type="text/javascript"
	src="http://lightbox.in.coocan.jp/prototype.js">
</SCRIPT>
<SCRIPT language="javascript" type="text/javascript">

// *********************************************************
// 関数
// *********************************************************
function doAction( strValue ) {

	alert( strValue )

	return true;
}

</SCRIPT>
</HEAD>

<!-- *******************************************************
 BODY
******************************************************** -->
<BODY>

<!-- *******************************************************
 フォーム
******************************************************** -->
<FORM
	name="frmMain"
	method="GET"
>

<INPUT type="button" value="実行" onClick='doAction("引数");'>

</FORM>

</BODY>
</HTML>
>
</RESOURCE>

<COMMENT>
************************************************************
 レジストリ登録用データ
************************************************************
</COMMENT>
<RESOURCE id="regData">
<![CDATA[
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\.layla001]
@="layla001"

[-HKEY_CLASSES_ROOT\.layla001\ShellNew]

[HKEY_CLASSES_ROOT\.layla001\ShellNew]
"Command"="wscript.exe \"$SCRIPT\" \"%1\""

[HKEY_CLASSES_ROOT\layla001]
@="HTML テンプレート"

[HKEY_CLASSES_ROOT\layla001\shell]

[HKEY_CLASSES_ROOT\layla001\shell\open]

[HKEY_CLASSES_ROOT\layla001\shell\open\command]
@="\"notepad.exe\" \"%1\""
>
</RESOURCE>

<COMMENT>
************************************************************
 登録用スクリプト
************************************************************
</COMMENT>
<RESOURCE id="CopyTemplate">
<![CDATA[
Set WshShell = WScript.CreateObject("WScript.Shell")
Set Fso = WScript.CreateObject("Scripting.FileSystemObject")
strTemplate = "_Template.htm"

on error resume next
strTarget = WScript.Arguments(0)
aData = Split( strTarget, "\" )
strTarget = ""
For I = 0 to Ubound( aData ) - 1
	strTarget = strTarget & aData( I ) & "\"
Next
if Fso.FileExists(strTarget & strTemplate) then
	if vbOK = MsgBox( "テンプレートファイルが既に存在しますが、置き換えますか?", vbOKCancel, "laylaClass" ) then
		Call Fso.CopyFile( "$FROM", strTarget & strTemplate, True )
	end if
else
	Call Fso.CopyFile( "$FROM", strTarget & strTemplate, False )
end if
on error goto 0
]]>
</RESOURCE>

</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
【+lhaca 用】 WEB WSH インストーラ ( No.11 )
日時: 2018/01/28 01:34
名前: lightbox
WEB 上にあるファイルをダウンロードしてインストールし、
インストール後の設定もしてしまおうというスクリプトです。

拡張子:
1) すでにインストールされている場合はアンインストールする
2) インストールを実行する
3) 設定済の Lhaca.ini を Windows ディレクトリに書き込む
4) Sendto ディレクトリにショートカットを作成する
ブラウザでダウンロード
拡張子:
http://park8.wakwak.com/~app/Lhaca/Lhaca124.EXE
上記 URL がリンク切れで使用できない場合は、 install_lhaca.wsf をダウンロードしてエディタで該当部分を変更すれば、使用できます。   ↓該当部分
拡張子:
' ***********************************************************
' lhaca をダウンロードする URL
' ***********************************************************
strDownloadPlace = "http://park8.wakwak.com/~app/Lhaca/Lhaca124.EXE"
拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )
Call laylaLoadFunction( "wmiReg.vbs" )
Call laylaLoadFunction( "toolFunction.vbs" )

'Crun

' ***********************************************************
' lhaca をダウンロードする URL
' ***********************************************************
strDownloadPlace = "http://park8.wakwak.com/~app/Lhaca/Lhaca124.EXE"


' ***********************************************************
' ダウンロード
' ***********************************************************
ret = HTTPDownload( strDownloadPlace, TempDir & "\Lhaca124.EXE" )
if not ret then
	Wscript.Echo ErrorMessage
	Wscript.Quit
end if

Wscript.Echo strDownloadPlace & " をダウンロードしました"

' ***********************************************************
' アンインストール
' ***********************************************************
strValue = ""
strPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\lhaca"
Call WMIRegGetStringValue( HKEY_LOCAL_MACHINE, strPath, "UninstallString", strValue )

if strValue <> "" then
	ret = GetStringDir( strValue )
	' アンインストール
	RunSync( Dd(ret & "\lhaca.exe") & " /u" )
	Wscript.Echo "lhaca をアンインストールしました"
end if

' ***********************************************************
' インストール
' ***********************************************************
RunSync( Dd(TempDir & "\Lhaca124.EXE") )
Wscript.Echo "lhaca をインストールしました"

' ***********************************************************
' ダウンロードファイルの削除
' ***********************************************************
GetFso
Call Fso.DeleteFile( TempDir & "\Lhaca124.EXE", True )

' ***********************************************************
' Lhaca.ini 出力
' ***********************************************************
TargetPath = WinDir & "\Lhaca.ini"
strText = GetInline( "Lhaca_ini" )
Call PutTextFile( TargetPath, strText )

' ***********************************************************
' ショートカット作成
' ***********************************************************
MsgOk("Sendto ディレクトリにショートカットを作成します")
strValue = ""
strPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\lhaca"
Call WMIRegGetStringValue( HKEY_LOCAL_MACHINE, strPath, "UninstallString", strValue )
ret = GetStringDir( strValue )

Set obj = WshShell.CreateShortcut( SendtoDir & "\+Lhaca.lnk")
obj.TargetPath = Dd(ret & "\lhaca.exe")
obj.WindowStyle = 1
obj.IconLocation = ret & "\lhaca.exe"
obj.Description = "+Lhaca"
obj.WorkingDirectory = ret
obj.Save

Wscript.Echo "処理が終了しました"

</SCRIPT>

<COMMENT>
************************************************************
 Lhaca.ini
************************************************************
</COMMENT>
<RESOURCE id="Lhaca_ini">
<![CDATA[
[OrigAsso]
ZIP=CompressedFolder
ZIPXP=504;0506000000000000000000000000000000000000
CAB=CLSID\{0CD7A5C0-9F37-11CE-AE65-08002B2E1262}
[OrigIcon]
ZIP=%SystemRoot%\system32\zipfldr.dll
CAB=cabview.dll,0
[Option]
MeltDirType=1
CompDirType=2
CompType=0
MeltForAllArc=1
MeltMakeDir=1
MeltOpenDir=1
CompOpenDir=1
MeltOverWrite=1
CompOverWrite=1
AssoLzh=0
AssoZip=0
NoIcon=0
AssoCab=0
AssoTgz=0
AssoArj=0
AssoRar=0
]]>
</RESOURCE>

</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
IP アドレスの情報 ( No.12 )
日時: 2018/01/28 01:34
名前: lightbox
http://winofsql.jp/wsf/NetworkAdapter.wsf

拡張子:
<JOB>
<COMMENT>
************************************************************
 WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )

Crun

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
	& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Wscript.Echo "【IP アドレスの情報】"
Wscript.Echo "----------------------------------------------------"
Set objTargets = objWMIService.ExecQuery( _
	"select * from Win32_NetworkAdapterConfiguration " & _
	"where IPEnabled = True" _
	)
For Each objTarget in objTargets
	Wscript.Echo RpadB("Caption:", " ", 13 ) & objTarget.Caption
	Wscript.Echo RpadB("MACAddress:", " ", 13 ) & objTarget.MACAddress
	For Each strData in objTarget.IPAddress
		Wscript.Echo RpadB("IP Address:", " ", 13 ) & strData
		Exit For
	Next
	For Each strData in objTarget.IPSubnet
		Wscript.Echo RpadB("Subnet:", " ", 13 ) & strData
		Exit For
	Next
Next

</SCRIPT>
</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
【DF 用】 オンラインインストーラ : VBScript ( No.13 )
日時: 2018/02/02 17:44
名前: lightbox
http://winofsql.jp/wsf/df.wsf

ベクターに登録されている、DF をダウンロードインストールします。
この URL は変更される可能性が高いので注意して下さい。

拡張子:
http://ftp.vector.co.jp/pack/win95/util/text/diff/df141.lzh
拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )
Call laylaLoadFunction( "toolFunction.vbs" )

' 管理者として実行を強制する
Set obj = Wscript.CreateObject("Shell.Application")
if Wscript.Arguments.Count = 0 then
	obj.ShellExecute "cscript.exe", WScript.ScriptFullName & " runas & pause", "", "runas", 1
	Wscript.Quit
end if

' ***********************************************************
' ダウンロードする URL
' ***********************************************************
strDownloadPlace = "http://ftp.vector.co.jp/pack/win95/util/text/diff/df141.lzh"

' ***********************************************************
' ダウンロード
' ***********************************************************
ret = HTTPDownload( strDownloadPlace, TempDir & "\df.lzh" )
if not ret then
	Wscript.Echo ErrorMessage
	Wscript.Quit
end if

Wscript.Echo strDownloadPlace & vbCrLf & " をダウンロードしました"

' ***********************************************************
' 解凍ソフトの一時ダウンロード
' ***********************************************************
strDownloadPlace = "http://lightbox.in.coocan.jp/Lhasa.exe"

' ***********************************************************
' ダウンロード
' ***********************************************************
ret = HTTPDownload( strDownloadPlace, TempDir & "\Lhasa.exe" )
if not ret then
	Wscript.Echo ErrorMessage
	Wscript.Quit
end if

Wscript.Echo "解凍ソフトをダウンロードしました"

strCommand = Dd( TempDir & "\Lhasa.exe" ) & " -d- -a -q -f -e- " & Dd(TempDir & "\df.lzh")
RunSync(strCommand)

Wscript.Echo "ソフトウェアをテンポラリフォルダに解凍しました"

GetFso

' ***********************************************************
' 解凍ディレクトリの移動
' ***********************************************************
Call Fso.CopyFolder( TempDir & "\df", ProgDir & "\", True )
Wscript.Echo "ソフトウェアをプログラムフォルダへコピーしました"

Call Fso.DeleteFolder( TempDir & "\df" )
Wscript.Echo "テンポラリフォルダのファイルを削除しました"

' ***********************************************************
' ダウンロードファイルの削除
' ***********************************************************
Call Fso.DeleteFile( TempDir & "\df.lzh", True )
Call Fso.DeleteFile( TempDir & "\Lhasa.exe", True )
Wscript.Echo "ダウンロードファイルを削除しました"

' ***********************************************************
' ショートカット作成
' ***********************************************************
if YesNo("デスクトップにショートカットを作成しますか?") then

	Set obj = WshShell.CreateShortcut( DesktopDir & "\df.lnk")
	obj.TargetPath = Dd( ProgDir & "\df\DF.exe")
	obj.WindowStyle = 1
	obj.IconLocation = ProgDir & "\df\DF.exe"
	obj.Description = "DF"
	obj.WorkingDirectory = ProgDir & "\df"
	obj.Save
	Wscript.Echo "デスクトップにショートカットを作成しました"

end if

MsgOk( "処理が終了しました   " )

</SCRIPT>

</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス
【JGREP 用】 WEB WSH インストーラ ( 解凍機能版 ) ( No.14 )
日時: 2018/02/02 17:45
名前: lightbox
http://winofsql.jp/wsf/jgrep2.wsf

JGREP は、要するに 全文検索 を行うソフトですが、
正規表現を使用する事によって、プログラマを助けます。

そのサンプルは、オプション画像の下にあるので参照して下さい

↓インストール直後のスクリーンショット



オプション 1 オプション 2
以下は、単純に "Dd" という文字列を探しています 正規表現の function\s+Dd で、関数の定義場所を探しています WEB WSH(インストール) コード↓
拡張子:
<JOB>
<COMMENT>
************************************************************
 WEB WSH 実行スケルトン
************************************************************
</COMMENT>

<COMMENT>
************************************************************
 外部スクリプト定義
************************************************************
</COMMENT>
<SCRIPT
	language="VBScript"
	src="http://lightbox.in.coocan.jp/laylaClass.vbs">
</SCRIPT>

<SCRIPT language=VBScript>
' ***********************************************************
' 処理開始
' ***********************************************************
Call laylaFunctionTarget( "http://lightbox.in.coocan.jp/" )
Call laylaLoadFunction( "baseFunction.vbs" )
Call laylaLoadFunction( "toolFunction.vbs" )

Crun2 110

sId = "jgrep2"
sPg = "JGREP2.exe"

' ***********************************************************
' ダウンロードする URL
' ***********************************************************
strDownloadPlace = "http://ftp.vector.co.jp/pack/win95/util/text/find/jgrep205.lzh"

' ***********************************************************
' ダウンロード
' ***********************************************************
ret = HTTPDownload( strDownloadPlace, TempDir & "\" & sId & ".lzh" )
if not ret then
	Wscript.Echo ErrorMessage
	Wscript.Quit
end if

Wscript.Echo strDownloadPlace & " をダウンロードしました"

' ***********************************************************
' 解凍ソフトの一時ダウンロード
' ***********************************************************
strDownloadPlace = "http://lightbox.in.coocan.jp/Lhasa.exe"

' ***********************************************************
' ダウンロード
' ***********************************************************
ret = HTTPDownload( strDownloadPlace, TempDir & "\Lhasa.exe" )
if not ret then
	Wscript.Echo ErrorMessage
	Wscript.Quit
end if

Wscript.Echo strDownloadPlace & " をダウンロードしました"

strCommand = Dd( TempDir & "\Lhasa.exe" ) & " -d- -a -q -f -e- " & Dd(TempDir & "\" & sId & ".lzh")
RunSync(strCommand)

GetFso

' ***********************************************************
' 解凍ディレクトリの移動
' ***********************************************************
' Call Fso.CreateFolder(ProgDir & "\" & sId)
Call Fso.CopyFolder( TempDir & "\" & sId & "\jgrep205", ProgDir & "\" & sId, True )
Call Fso.DeleteFolder( TempDir & "\" & sId )

' ***********************************************************
' ダウンロードファイルの削除
' ***********************************************************
Call Fso.DeleteFile( TempDir & "\" & sId & ".lzh", True )
Call Fso.DeleteFile( TempDir & "\Lhasa.exe", True )

' ***********************************************************
' ショートカット作成
' ***********************************************************
if OkCancel("デスクトップにショートカットを作成しますか?") then

	Set obj = WshShell.CreateShortcut( DesktopDir & "\" & sId & ".lnk")
	obj.TargetPath = Dd( ProgDir & "\" & sId & "\" & sPg )
	obj.WindowStyle = 1
	obj.IconLocation = ProgDir & "\" & sId & "\" & sPg
	obj.Description = "正規表現による文字列検索ソフト"
	obj.WorkingDirectory = ProgDir & "\" & sId
	obj.Save
	Wscript.Echo "デスクトップにショートカットを作成しました"

end if

MsgOk( "処理が終了しました   " )

</SCRIPT>

</JOB>
このアーティクルの参照用URLをクリップボードにコピー メンテナンス