Sha256: ecb5f1fd000f7b1afd94c39e37f4ba8f602a0ae8639404416f285a489a34afa8
Contents?: true
Size: 916 Bytes
Versions: 17
Compression:
Stored size: 916 Bytes
Contents
myfilename = "C:\Wikipedia - VBScript - Example - Hello World.txt" MakeHelloWorldFile myfilename Sub MakeHelloWorldFile (FileName) 'Create a new file in C: drive or overwrite existing file Set FSO = CreateObject("Scripting.FileSystemObject") If FSO.FileExists(FileName) Then Answer = MsgBox ("File " & FileName & " exists ... OK to overwrite?", vbOKCancel) 'If button selected is not OK, then quit now 'vbOK is a language constant If Answer <> vbOK Then Exit Sub Else 'Confirm OK to create Answer = MsgBox ("File " & FileName & " ... OK to create?", vbOKCancel) If Answer <> vbOK Then Exit Sub End If 'Create new file (or replace an existing file) Set FileObject = FSO.CreateTextFile (FileName) FileObject.WriteLine "Time ... " & Now() FileObject.WriteLine "Hello World" FileObject.Close() MsgBox "File " & FileName & " ... updated." End Sub
Version data entries
17 entries across 17 versions & 1 rubygems