Using Operators in Folder Titles RRS feed

  • General discussion

  • I'm going to be perfectly honest: I have no idea how to use VBScript, and am just using resources online.

    That said, I am trying to loop a script that creates a folder, but every time it loops adds 1 to the folder's name, as to create a new folder each time. I don't know how operators work, and just inputting an equation into the title doesn't do anything.

    If someone could help me out, and maybe even tell me what some of this code means, that would be much appreciated.

    Option Explicit
    Dim objNetwork, objComputer
    Dim objFSO, objFSOText, objFolder, objFile
    Dim strDirectory, strFile, MakeObject
    strDirectory = "Folder (Insert Operator Here)"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFolder = objFSO.CreateFolder(strDirectory)
    • Changed type Bill_Stewart Monday, March 12, 2018 9:24 PM
    • Moved by Bill_Stewart Monday, March 12, 2018 9:24 PM Unanswerable drive-by question
    Tuesday, February 6, 2018 5:15 PM

All replies

  • The code doesn't do anything at all. It declares some variables (Dim), assigns a string value to a variable (stdDirectory), and creates an object (System.FileSystemObject). Then it assigns a folder object to the objFolder variable, and then it calls a non-existent procedure (doloop).

    Unfortunately, this is not a "train me in VBScript" forum. We would recommend starting with PowerShell rather than using VBScript anyway. There is a list of good introductory PowerShell learning resources at the Learn link right at the top of this forum.

    -- Bill Stewart [Bill_Stewart]

    Tuesday, February 6, 2018 6:26 PM