Using a simple VB Form to rename files using CMD Prompt (done in Excel - screenshots)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Max Anstey
    New Member
    • Aug 2012
    • 3

    #1

    Using a simple VB Form to rename files using CMD Prompt (done in Excel - screenshots)

    I have a very VERY basic knowledge of VB6, I've been using it for years but following tutorials etc. I'm not stupid but far from knowledgeable.

    Here is (hopefully) all you'll need to know what I need help with.

  • Max Anstey
    New Member
    • Aug 2012
    • 3

    #2
    On another website I've learned about the Shell() function and VB's native rename file function 'Name OldFileName As NewFileName' so I have more to ask:

    What functions are necessary for me to browse for a folder, and then for VB to copy all the filenames to the clipboard (to then paste into the script that'll be executed in the cmd prompt as "ren <orig filename> <new filename>/ as Name <orig filename> As <new>)?
    I'm looking for absolute basics so I can go off and google what else I need rather than being given the code, afterall I'm not going to learn getting given the code!

    Also, how can I save the final string of text as a batch file? Better yet, is it possible to, instead of exporting and then runnning the batch file, simply executing the dos command inside the executable? From what you've told me, obviously not like this as i'm making t up, would it be as simple as "shell() run <final string of text>"?

    Apologies for my lack of knowledge; I've just discovered I'd use Shell() to OPEN the cmd prompt as opposed to the function itself opening the cmd prompt

    Comment

    • Max Anstey
      New Member
      • Aug 2012
      • 3

      #3
      http://www.vbforums.com/showthread.p...th-screenshots)

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        If you have a browse through the "Insights" part of this VB 4/5/6 forum (click the "Insights" tab up top) you'll find various articles on how to read and write files, list the contents of a folder, execute a shell command from VB and similar topics.

        Comment

        Working...