vb scripts

The-One

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

Thanks
 
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
 
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
 
You guys are the best Thanks for all your help im sure i will come right now :)
 
Top
Sign up to the MyBroadband newsletter
X