Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Batch File to Open ALL Links in Folder

26 Dec 2009   #1
JOSHSKORN

Windows 7 Ultimate 64-bit
 
 
Batch File to Open ALL Links in Folder

I have a few LNK files in the same folder and would like to write a batch file that opens all of these links without explicitly having each link listed in the batch file. Is there a way to open all links in one folder? I would presume so, considering Windows has for the most part always had a Startup folder, but I'm not interested in using the Startup folder. I would like these items to open only if I access this batch file.

Is there a way to do this?


My System SpecsSystem Spec
.
26 Dec 2009   #2
WindowsStar

Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
 
 

@joshskorn

Here is a VBScript that will do what you want. It has no error checking it will just run everything in the C:\Program Files\Links folder.



Code:
 
Set WshShell = WScript.CreateObject("WScript.Shell")
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService. _
ExecQuery("Select * from CIM_DataFile where Path = '\\Program Files\\Links\\'")
For Each objFile in colFiles
WshShell.Run Chr(34) & objFile.Name & Chr(34) 
Next
My System SpecsSystem Spec
27 Dec 2009   #3
JOSHSKORN

Windows 7 Ultimate 64-bit
 
 

Quote   Quote: Originally Posted by WindowsStar View Post
@joshskorn

Here is a VBScript that will do what you want. It has no error checking it will just run everything in the C:\Program Files\Links folder.

@WindowsStar

I'm not familiar with VBScript files. How do I save this as? Is it still a *.bat file or something else?
My System SpecsSystem Spec
.

27 Dec 2009   #4
ccatlett1984

 

.vbs
My System SpecsSystem Spec
27 Dec 2009   #5
JOSHSKORN

Windows 7 Ultimate 64-bit
 
 

Quote   Quote: Originally Posted by ccatlett1984 View Post
.vbs
Thank you. I actually found out using Google and was just about to post here that the solution provided by WindowsStar worked.
My System SpecsSystem Spec
Reply

 Batch File to Open ALL Links in Folder




Thread Tools




Similar help and support threads
Thread Forum
Batch file to open multiple browsers
Hello, I need 10 different browsers open and after some searching found a way to write a batch file which worked but with a couple of problems. The problem is it opens them all at once and several of the browsers crash. So I tried adding a ping after each one as follows: @echo off start /D...
Browsers & Mail
I need a batch file to open a random file within a certain folder/path
I want a batch to select and open a random link file in a folder i have. All the links are music videos I like to listen to, and I kind of want to just have an option for 'surprise me!'. I can change the file names if I have to, and I have a basic batch file ability. I know the simple commands,...
General Discussion
Can't open links in my user folder
I've recently build a new computer and it's great. However I'm having a problem with opening symbolic links. When I try to open a symbolic link, I get an error message saying the location is unavailable and access is denied. How can I fix this?
General Discussion
Batch File that grabs file names from folder to insert into batch file
Ok I'm totally at a loss on how to word this so I'm just going to write it out the best that I can... :confused: First I have a batch file that I'm writing that will convert mp4 files to mp3 files (I have a lot) for a buddies band using ffmpeg. Here's the code that I'm using: ffmpeg -i...
General Discussion
batch file open file for program in the startup folder
I have a computer that is a drone specifically for an outside LED sign. This computer is designed to never shut off and doesn't have any other program on it besides Operating System and the sign software. I need to create a batch file that I can place in the "start-up" folder that will open the...
General Discussion
Saved links in favorites File won’t open
When I save “some” web pages in my Favorites File, I go back to double click on them, and they don’t open. Using IE 7 or 8 Why is that and how can I fix this? Scotty13
Browsers & Mail


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd

All times are GMT -5. The time now is 12:41.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App