VBS - Open Files

Soldato
Joined
17 Sep 2005
Posts
2,983
Location
Everywhere
Hiyo,

Trying to create a VB Script that will ask you for a folder path and then open all the files in that folder with Notepad. I don't want to have to keep editing the VBS file to put the path in.

At the moment I have this, but I can't figure out how to implement the InputBox command. Any help appreciated!

Code:
Dim objFSO
Dim MyFile
Dim MyFolder
Dim objShell

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objShell = WScript.CreateObject("WScript.Shell")

Set MyFolder = objFSO.GetFolder("W:\Folder")

For Each MyFile In MyFolder.Files    
        objShell.Run("notepad " + MyFile.Path)
  
Next

Thanks
 
Is there a way, if I add a Right Click context menu option, whereby if I right click on one of the folders, and there is a option to open all files within that folder with notepad.
 
Thanks for your responses. Basically, I have a Folder Structure with hundreds and hundreds of folders all with files which have been archived with Permabit. In order to retrieve, the files need to be opened, so I want a script which scans the whole Job Folder and opens up every single file which has been archived.
 
Back
Top Bottom