Batch File to Open ALL Links in Folder

JOSHSKORN

New member
Member
VIP
Local time
7:41 AM
Messages
121
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 Computer My Computer

At a glance

Windows 7 Ultimate 64-bitE6750 OC'd ~ 2.9 MhzDDR2 800 MHz 4GBGTX 460 SE 1GB
Computer Manufacturer/Model Number
N/A
OS
Windows 7 Ultimate 64-bit
CPU
E6750 OC'd ~ 2.9 Mhz
Motherboard
P5N-E
Memory
DDR2 800 MHz 4GB
Graphics Card(s)
GTX 460 SE 1GB
Sound Card
Realtek Audio (Onboard sound)
Hard Drives
Seagate 500 GB HD
PSU
750 watt
@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
 
Last edited by a moderator:

My Computer My Computer

At a glance

Windows 7 Enterprise (x64); Windows Server 20...16GB
Computer type
PC/Desktop
Computer Manufacturer/Model Number
Dell OP7010
OS
Windows 7 Enterprise (x64); Windows Server 2008 R2 (x64)
Memory
16GB
Monitor(s) Displays
4 Dell 24" LCD
Screen Resolution
1280x1024
Keyboard
Dell
Mouse
Dell Optical
Internet Speed
40meg
@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 Computer My Computer

At a glance

Windows 7 Ultimate 64-bitE6750 OC'd ~ 2.9 MhzDDR2 800 MHz 4GBGTX 460 SE 1GB
Computer Manufacturer/Model Number
N/A
OS
Windows 7 Ultimate 64-bit
CPU
E6750 OC'd ~ 2.9 Mhz
Motherboard
P5N-E
Memory
DDR2 800 MHz 4GB
Graphics Card(s)
GTX 460 SE 1GB
Sound Card
Realtek Audio (Onboard sound)
Hard Drives
Seagate 500 GB HD
PSU
750 watt
.vbs
 

My Computer My Computer

At a glance

windows 7 RTM x64Phenom II 965 Quad Core 3.4GhzMushkin Blackline 8GB (4x2gb)XFX Radeon 5970 Black Edition
Computer Manufacturer/Model Number
Black_Box (homebuilt)
OS
windows 7 RTM x64
CPU
Phenom II 965 Quad Core 3.4Ghz
Motherboard
Asus M4A79T Deluxe
Memory
Mushkin Blackline 8GB (4x2gb)
Graphics Card(s)
XFX Radeon 5970 Black Edition
Sound Card
onboard
Monitor(s) Displays
Dell 2408WPF-main Dell E248WFP-secondary
Screen Resolution
1920x1200-main 1920x1200-secondary
Hard Drives
OCZ Vertex Limited Edition 100GB (OS)
x1 WD Black Edition 500GB drive (Storage)
PSU
XFX 850w Black Edition (Modular)
Case
Mountian Mods H2go
Cooling
CoolITSystems ECO A.L.C.
Keyboard
Logitech MX 5500 wireless keyboard
Mouse
Razor Copperhead
Internet Speed
16Mb down/2Mb up Wowway Cable Internet

My Computer My Computer

At a glance

Windows 7 Ultimate 64-bitE6750 OC'd ~ 2.9 MhzDDR2 800 MHz 4GBGTX 460 SE 1GB
Computer Manufacturer/Model Number
N/A
OS
Windows 7 Ultimate 64-bit
CPU
E6750 OC'd ~ 2.9 Mhz
Motherboard
P5N-E
Memory
DDR2 800 MHz 4GB
Graphics Card(s)
GTX 460 SE 1GB
Sound Card
Realtek Audio (Onboard sound)
Hard Drives
Seagate 500 GB HD
PSU
750 watt
Back
Top