vb scripts

The-One

Well-Known Member
Joined
Dec 28, 2005
Messages
137
I need a vb scripts that promps the user to key in the a name and create a new folder with that name.

Thanks
 

raZer

Well-Known Member
Joined
Sep 13, 2005
Messages
375
I don't know how to do that in VBscript but in VB6 you would use this (maybe you can adapt it)
Code:
Sub Main()
Dim strName As String

strName = InputBox("Enter name")
MkDir "C:\" & strName
End Sub
 

Nivec

Well-Known Member
Joined
Mar 4, 2005
Messages
325
Basic script to create a folder in the script folder, there is plenty of help online, so you should be able to adapt it with little hassle.

Dim objFSO
Dim strFLD
Dim strCPath

strCPath = Replace(WScript.ScriptFullName,WScript.ScriptName,"",1,-1,1)

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

strFLD = trim(INPUTBOX("Folder Name"))

If len(strFLD) = 0 Then WScript.Quit(0)

If Not objFSO.FolderExists(strCPath & strFLD) then
objFSO.CreateFolder(strCPath & strFLD)
End If

Set objFSO = Nothing
 

The-One

Well-Known Member
Joined
Dec 28, 2005
Messages
137
You guys are the best Thanks for all your help im sure i will come right now :)
 
Top