Problem with batch file.

Man of Honour
Joined
15 Mar 2004
Posts
28,140
Location
Liverpool
I am trying to create a batch file, such that when I click it, all the folders in my storage volume open up.

It is running fine for those folders that have a single word as their name, but for those with more than one - I get "cant find blah blah" errors.

Can anybody help as to why? Do I need to use speech marks or something?

@ECHO OFF

START D:\Singles
START D:\Albums
START D:\Desktop Wallpapers
START D:\Drivers and Firmware
START D:\Dump
START D:\Movies
START D:\Other Items
START D:\Photos and Pictures
START D:\TV Show & Movie Clips
START D:\Utilities
 
Code:
@ECHO OFF

START "D:\Singles"
START "D:\Albums"
START "D:\Desktop Wallpapers"
START "D:\Drivers and Firmware"
START "D:\Dump"
START "D:\Movies"
START "D:\Other Items"
START "D:\Photos and Pictures"
START "D:\TV Show & Movie Clips"
START "D:\Utilities"

Quotes not needed for the folders that don't have spaces, but it's a good habit (IMO) to quote file/folder locations.
 
I am trying to create a batch file, such that when I click it, all the folders in my storage volume open up.

It is running fine for those folders that have a single word as their name, but for those with more than one - I get "cant find blah blah" errors.

Can anybody help as to why? Do I need to use speech marks or something?

This might work better???

Code:
@echo off
set dir_root=D:\
FOR /f %%A IN ('dir  /AD /B "%dir_root%"') DO (
	START explorer /root,"%dir_root%\%%~A"
)
 
Just a guess but perhaps it's trying to do them too quickly, give this a try:


START /wait "path"


Worth a shot, can't see anything wrong with the batch file. :p
 
ah damn just had a though. If is saying the path isn't known etc. Try putting the paths in without quotes and in their short format. To find what it is go to D: and put this in the command prompt:

dir /x

use the short version, usually something like c:\mydocu~1 instead of C:\my documents

If nothing else it's something to try!
 
Try this and see if it works..
Change F to whichever drive letter your using..
Code:
START F:\Singles
START F:\Albums
START F:\Deskto~1
START F:\Driver~1
START F:\Dump
START F:\Movies
START F:\OtherI~1
START F:\Photos~1
START F:\TVShow~1
START F:\Utilities
 
Yeap - just edited it - and Kami has cracked it. :)

Thanks for your help fellas.

*Hands out biscuits* :p

The final bit :

@ECHO OFF

START /min D:\Singles
START /min D:\Albums
START /min D:\DESKTO~1
START /min D:\DRIVER~1
START /min D:\Dump
START /min D:\Movies
START /min D:\OTHERI~1
START /min D:\PHOTOS~1
START /min D:\TVSHOW~1
START /min D:\Utilities
 
Last edited:
If you want to use long folder names then add the word explorer after /min so

START /Min Explorer "D:\Desktop Wallpapers"

etc...
 
Back
Top Bottom