Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Option Explicit
- Dim fso, objWRITE, objREAD, CD, current, create
- Const vbRead=1, vbAppend=8
- Set fso = CreateObject("Scripting.FileSystemObject")
- CD = Replace(Wscript.ScriptFullName, Wscript.ScriptName, "H.bat")
- '-----------------------------
- 'SETUP PROCESS
- '-----------------------------
- Sub Refresh
- Set objREAD = fso.OpenTextFile(CD,vbRead)
- current=objREAD.ReadAll
- objREAD.Close
- End Sub
- Sub Main
- Do
- create=InputBox(current ,"Text Editor: [*] to quit")
- If create = "*" then
- wscript.quit
- ElseIf create = "" then
- Set objWRITE = fso.OpenTextFile(CD,vbAppend,1)
- objWRITE.writeblanklines(1)
- objWRITE.Close
- Call Refresh
- Else
- Set objWRITE = fso.OpenTextFile(CD,vbAppend,1)
- objWRITE.write create
- objWRITE.Close
- Call Refresh
- End If
- Loop
- End Sub
- '---------------------------------
- 'WRITTING PROCESS
- '---------------------------------
- If Not fso.FileExists(CD) then
- Call Main
- Else
- If fso.GetFile(CD).Size = 0 Then
- Call Main
- Else
- Call Refresh
- Call Main
- End If
- End If
- Wscript.Quit
- CD.Close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement