• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Folder creation

udprocks

Member
Hallo Dear All,

If its possible can anyone please help me with this ?

I want to create Folders With name from E001 to E150 with batch file , if it is possible please help me.

thanks in advance .
 
Hi,

Just copy the below code & paste the same in a notepad then save as it fol.bat

Don't forget to change the strDirectory = "C:\Users\dEEPAK\Desktop\t\"
to
your dir where you need to create the folder.


Code:
Option Explicit
Dim objFSO, objFolder, objShell, strDirectory, strfol, fn, i

'change it
strDirectory = "C:\Users\dEEPAK\Desktop\t\"

' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")

for i = 1 to 150
fn = right("00" & i, 3)
strfol = strDirectory & "E" & fn

If not objFSO.FolderExists(strfol) Then
   Set objFolder = objFSO.CreateFolder(strfol)
End If
next
WScript.Quit
 
Hi,

Just copy the below code & paste the same in a notepad then save as it fol.bat

Don't forget to change the strDirectory = "C:\Users\dEEPAK\Desktop\t\"
to
your dir where you need to create the folder.


Code:
Option Explicit
Dim objFSO, objFolder, objShell, strDirectory, strfol, fn, i

'change it
strDirectory = "C:\Users\dEEPAK\Desktop\t\"

' Create the File System Object
Set objFSO = CreateObject("Scripting.FileSystemObject")

for i = 1 to 150
fn = right("00" & i, 3)
strfol = strDirectory & "E" & fn

If not objFSO.FolderExists(strfol) Then
   Set objFolder = objFSO.CreateFolder(strfol)
End If
next
WScript.Quit


Hallo Deepak,

Good morning,

sorry i m fresher for it so i have same problem again with this code , also i have created like this "attached" like this can u please see this and tell what wrong in this..

Thank you again...
 

Attachments

  • fol.txt
    391 bytes · Views: 3
Back
Top