Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

create a file with vbscript

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
2,532
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Apr 7, 2009

How to create a file using vbscripting. All thanks goes to Stupidgaylogincrap
script here:

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")

Const Append = 8
Dim FDir
FDir = ("Area where file will be saved")
Const FName_Ext = "Title of document.txt"
Dim Final
Final = FDir + FName_Ext

Dim objtxt
set objtxt = objFSO.CreateTextFile(Final, True)
Set objtxt = Nothing

Dim FWrite
Set FWrite = objFSO.OpenTextFile(Final, Append)

FWrite.WriteLine("this is the text in the file.!!! hahaha lol wohoo yada yada yada. okay done!")
FWrite.Close()
Set FWrite = Nothing
Set objFSO = Nothing

Category:

Education

Tags:

License:

Standard YouTube License

Link to this comment:

Share to:

Uploader Comments (vbsripter)

  • yes, you can change the file extension. just know that if you use a vbscript to make another vbscript, when you use certain characters " or ) it will not work because the vbscript will mistake it as a command for it and so will alsways never work.

see all

All Comments (10)

Sign In or Sign Up now to post a comment!
  • Plz Help!

    When I activated that VBS, nothing happens!

    What I type in ("Area where file will be saved") is ("C:\Documents and Settings\COMPAQ\Desktop").

  • You know, you have a rogue on your computer. "Security Tools"

  • It's really cool! If you want more VBScript eroors,look at my videos,yes?

  • You must change "Final = FDir + FName_Ext" to "Final = FDir & FName_Ext" to make it happen right. And...

    Change "Const FName_Ext = "Title of document.txt"" to "Const FName_Ext = "Title of document.vbs"" to make a vbs file! it workj correctly!

  • write**

  • lol...there is a very simpler way...

    1.open notepad

    2.and then right msgbox "The message inside",20,"and here u write the the title"

    3.u save it as .vbs

  • everywhere, where it says "txt" can i replace that with.. bat or vbs?? if not how can i create a file with diffrent extensions

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more