コメント |
http://winofsql.jp/wsf/newTemplate_layla002.wsf
@DIV
<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 & "\layla002.tpl"
TeplateText = GetInline( "Template" )
Call PutTextFile( TargetPath, TeplateText )
TargetPath = TemplateDir & "\layla002.vbs"
VbsText = GetInline( "CopyTemplate" )
VbsText = Replace( VbsText, "$FROM", TemplateDir & "\layla002.tpl" )
Call PutTextFile( TargetPath, VbsText )
TargetPath = TempDir & "\layla002.reg"
ScriptPath = Replace( TemplateDir & "\layla002.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[
// MKEditor for Windows Project
// Version 3.8
// ProjectFile:
/* ProjectItem */
Type=ntBox
Level=0
Name=ボックス
Lock=0
Comment=
Ext=
begin/*
*/end
/* ProjectItem */
Type=ntTrash
Level=0
Name=ゴミ箱
Lock=0
Comment=
Ext=
begin/*
*/end
]]>
</RESOURCE>
<COMMENT>
************************************************************
レジストリ登録用データ
************************************************************
</COMMENT>
<RESOURCE id="regData">
<![CDATA[
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\.layla002]
@="layla002"
[-HKEY_CLASSES_ROOT\.layla002\ShellNew]
[HKEY_CLASSES_ROOT\.layla002\ShellNew]
"Command"="wscript.exe \"$SCRIPT\" \"%1\""
[HKEY_CLASSES_ROOT\layla002]
@="MKEditor プロジェクト"
[HKEY_CLASSES_ROOT\layla002\shell]
[HKEY_CLASSES_ROOT\layla002\shell\open]
[HKEY_CLASSES_ROOT\layla002\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 = "_MKEditor.mkp"
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>
@END
|