To Create Single or Multiple Folders and In that folder automatically create Sub Folders by Script
To Create Single or Multiple Folders and In that folder automatically create Sub Folders by Script ,In the location where that Script resides.
Rate To Create Single or Multiple Folders and In that folder automatically create Sub Folders by Script
(1(1 Vote))
Dim lMsg
Dim objFSO
dim objShell
dim lFdName
dim lArray
dim i
dim lSubFdname
dim l2SubFdname
dim lPath
'---Create shell and filesystem objects
Set objShell = CreateObject("Wscript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
lSubFDName = "\Windows NT 5.1 Workstatoin Profile"
l2SubFDName = "\Notes_Cdi"
'lpath=InputBox("PLease enter Folder Path Here", "Yogi want Location")
lpath = WScript.ScriptFullName
lpath = Left(lpath, InstrRev(lpath, "\"))
if not right(lpath,1) = "\" then
lpath=lpath & "\"
end if
lfdname = InputBox("PLease enter GID Here", "Yogi want folder name")
if lfdname = "" then
call MsgBox("Please Enter the Folder Name !", vbCritical, "Yogi need Folder Name")
else
if instr(1,lfdname,",") > 0 then
lArray=split(lfdname,",")
for i = 0 to ubound(lArray)
lfdname=lArray(i)
if not lcase(left(lfdname,1)) = "u" then
lfdname="u" & lfdname
end if
lmsg=msgbox("are u sure want to create: " & lfdname & " Folder",vbyesno,"Yogi want confirmation")
if lmsg=vbyes then
If Not objFSO.folderexists(lpath & lfdname) Then
objFSO.CreateFolder(lpath & lfdname)
objFSO.CreateFolder(lpath & lfdname & "\" & lsubfdname)
objFSO.CreateFolder(lpath & lfdname & "\" & l2subfdname)
msgBox("Folder Ctreated.")
else
msgbox("Folder Already Exist!!")
end if
end if
next
else
if not lcase(left(lfdname,1)) = "u" then
lfdname="u" & lfdname
end if
lmsg=msgbox("are u sure want to create: " & lfdname & " Folder",vbyesno,"Yogi want confirmation")
if lmsg=vbyes then
If Not objFSO.folderexists(lpath & lfdname) Then
objFSO.CreateFolder(lpath & lfdname)
objFSO.CreateFolder(lpath & lfdname & "\" & lsubfdname)
objFSO.CreateFolder(lpath & lfdname & "\" & l2subfdname)
msgBox("Folder Ctreated.")
else
msgbox("Folder Already Exist!!")
end if
end if
end if
end if 'if lfdname = "" then
'---Clean up
Set objShell = Nothing
Set objFSO = Nothing
'=============================================================
'End Main Processing
'=============================================================
To Create Single or Multiple Folders and In that folder automatically create Sub Folders by Script Comments
No comments yet — be the first to post one!
Post a Comment