Advertisement

There's no such thing as a stupid question, but they're the easiest to answer.
Login
Search

Advertisement

Windows XP Windows XP
Search Search
Search for:
Tech Support Guy > > >

.bat file to open a folder


(!)

lightnb's Avatar
lightnb lightnb is offline
Member with 786 posts.
THREAD STARTER
 
Join Date: Jun 2002
Location: Seattle
Experience: Advanced
07-Jan-2007, 07:30 PM #1
.bat file to open a folder
I tried searching Google, but it just gave me pages of irrelevant junk....

I need to create a batch file, that when envoked opens a "windows Explorer" window, and goes to a specified folder. Anyone know what code will do this?

Thanks,

Nick
JohnWill's Avatar
Computer Specs
Retired Moderator with 106,412 posts.
 
Join Date: Oct 2002
Location: South Eastern PA, USA
07-Jan-2007, 07:35 PM #2
%SystemRoot%\explorer.exe "folder path"

where "folder path" is the complete folder path in quotes.
lightnb's Avatar
lightnb lightnb is offline
Member with 786 posts.
THREAD STARTER
 
Join Date: Jun 2002
Location: Seattle
Experience: Advanced
07-Jan-2007, 07:46 PM #3
Excellent. Thank you.

I'm having an issue with my other bat file as well:

Code:
start ../include/SP/ELM/Elemental Paperwork/Lighting/ELM_plot.mcd
The space in the folder name seems to be interfering...
JohnWill's Avatar
Computer Specs
Retired Moderator with 106,412 posts.
 
Join Date: Oct 2002
Location: South Eastern PA, USA
07-Jan-2007, 07:48 PM #4
Put quotes around the entire name.
lightnb's Avatar
lightnb lightnb is offline
Member with 786 posts.
THREAD STARTER
 
Join Date: Jun 2002
Location: Seattle
Experience: Advanced
07-Jan-2007, 09:31 PM #5
I have:

Quote:
start "../include/SP/ELM/Elemental Paperwork/Lighting/ELM_plot.mcd"
But all it does is open a command prompt, at the folder where the bat file is located...
Frank4d's Avatar
Computer Specs
Trusted Advisor with 9,126 posts.
 
Join Date: Sep 2006
Location: So. California
07-Jan-2007, 10:33 PM #6
Quote:
Originally Posted by lightnb
I have:



But all it does is open a command prompt, at the folder where the bat file is located...
Are you trying to run a batch file from within another batch file? I recently had a problem with this until I remembered to CALL the second batch file from within the first.
JohnWill's Avatar
Computer Specs
Retired Moderator with 106,412 posts.
 
Join Date: Oct 2002
Location: South Eastern PA, USA
07-Jan-2007, 10:35 PM #7
What do you expect it to do? Are you trying to launch the application associated with the file extension .MCD? You can invoke it with the file as a parameter on the command line in many cases.
lightnb's Avatar
lightnb lightnb is offline
Member with 786 posts.
THREAD STARTER
 
Join Date: Jun 2002
Location: Seattle
Experience: Advanced
07-Jan-2007, 11:10 PM #8
It should open the file using the default program (Vectorworks).

Quote:
start ../include/SP/ELM/ElementalPaperwork/Lighting/ELM_plot.mcd
works, because there are no spaces.

But if the folder name is "Elemental Paperwork" not "ElementalPaperwork" the space in the folder name causes the command to fail.

Is there a way to make it work with spaces in the folder names?
Frank4d's Avatar
Computer Specs
Trusted Advisor with 9,126 posts.
 
Join Date: Sep 2006
Location: So. California
07-Jan-2007, 11:34 PM #9
What happens if you enclose the entire drive/path/filename in quotes? It should work.
JohnWill's Avatar
Computer Specs
Retired Moderator with 106,412 posts.
 
Join Date: Oct 2002
Location: South Eastern PA, USA
08-Jan-2007, 10:27 AM #10
Quote:
Originally Posted by Frank4d
What happens if you enclose the entire drive/path/filename in quotes? It should work.
You mean like I suggested in post #4?
lightnb's Avatar
lightnb lightnb is offline
Member with 786 posts.
THREAD STARTER
 
Join Date: Jun 2002
Location: Seattle
Experience: Advanced
08-Jan-2007, 07:04 PM #11
Quote:
Originally Posted by Frank4d
What happens if you enclose the entire drive/path/filename in quotes? It should work.
It just opens a command prompt for some reason....
Frank4d's Avatar
Computer Specs
Trusted Advisor with 9,126 posts.
 
Join Date: Sep 2006
Location: So. California
08-Jan-2007, 07:24 PM #12
Move the first quote mark.
Use this: start .."/include/SP/ELM/Elemental Paperwork/Lighting/ELM_plot.mcd"
Not this: start "../include/SP/ELM/Elemental Paperwork/Lighting/ELM_plot.mcd"
As Seen On

BBC, Reader's Digest, PC Magazine, Today Show, Money Magazine
WELCOME TO TECH SUPPORT GUY!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.


(clock)
THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.

Search Tech Support Guy

Find the solution to your
computer problem!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


WELCOME
You Are Using: Server ID
Trusted Website Back to the Top ↑