VB Script for Creating New Folder

Here is a sample VB Script code for creating new directory.
The code will launch a dialog box for input as directory name. If you pass correct name and press OK, directory will get created.



Option Explicit
Dim objFSO, objFolder, strDirectory
strDirectory = InputBox("This is the the input box will say") 
if(0 = StrComp(strDirectory, "")) Then
WScript.Quit
End If
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.CreateFolder(strDirectory)
WScript.Echo "Directory : '" & strDirectory & "' created sucessfully."
WScript.Quit 

Comments

  1. how to use that script?? should i use Visual Basic program?? sorry, i'm newbie

    ReplyDelete
  2. Just copy pest this code in a text file. SAve it as a .vbs and double click that file. The script will execute.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to boot Samsung Galaxy SL( GT-I9003) in recovery mode

How to flash CWM Recovery to Samsung Galaxy SL( GT-I9003) using Odin

Exception handling with RestTemplate