Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 04-20-2007, 02:21 PM   #1 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default Batch

hi , i would like to get a batch file to run file.exe in c:/Program Files/Folder/

how would i do this / or is it not possiable ??

Wheres dos wizard
Yek is offline  
Old 04-20-2007, 03:48 PM   #2 (permalink)
 
Monster Techie

Join Date: May 2004

Location: Tucson, AZ, USA

Posts: 1,183

Vormund

Send a message via AIM to Vormund Send a message via MSN to Vormund Send a message via Yahoo to Vormund
Lightbulb Re: Batch

Hmm, of course there is...batch files are essentially pre-defined lists of commands...with a few extras.

Since there are spaces in the path/name, just surround it with quotes, eg:

test.bat:
"C:\Program Files\Java\jdk1.6.0_01\bin\javac" %1

using it:
test.bat MyFile.java

That would call the javac executable and use the first command line argument. More then you asked, I know, but...pretty much anything can be enclosed by double quotes, and should be when there's whitespace involved.

Woot off to class.
__________________
Vormund is offline  
Old 04-20-2007, 05:30 PM   #3 (permalink)
office politics's Avatar
 
It's all just 1s and 0s

Join Date: Jan 2004

Location: in the lab

Posts: 4,389

office politics will become famous soon enough

Default Re: Batch

if your running a executable file, you can append the file path & file name to the batch file ex "c:\program files\folder\program.exe" As Vormund posted, if the string has a space, the string will need to be enclosed in double quotes.

if you want to open a file that has a file association in windows, you can use the start command. ex. i want to open a word document named word.doc on a machine that has MS Word installed. You can append the following string to the batch file - start word.doc
office politics is offline  
Old 04-21-2007, 05:48 AM   #4 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default Re: Batch

so what command would i need to run C:/Program Files/Folder/File.exe
Yek is offline  
Old 04-21-2007, 04:45 PM   #5 (permalink)
 
Newb Techie

Join Date: Apr 2007

Posts: 7

khadeja is on a distinguished road

Default Re: Batch

sorry to interrupt but can u tell what a batch file is as i new to all these concepts
khadeja is offline  
Old 04-21-2007, 07:51 PM   #6 (permalink)
ben_ben's Avatar
 
Super Techie

Join Date: Feb 2006

Posts: 346

ben_ben

Default Re: Batch

a batch file is the same commands as the cmd.exe
so whatever you type in it to open whatever you want type in notepad and save as anything.bat
ben_ben is offline  
Old 04-22-2007, 12:02 AM   #7 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,682

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Batch

Just type the directory and name of the file and it will open.

Example: If you want to open C:\Hi.exe

You would type:

C:\Hi.exe
__________________

Need website help? PM me!
CrazeD is offline  
Old 04-22-2007, 03:32 AM   #8 (permalink)
Yek
 
T.F's Resident Cool Guy...

Join Date: Aug 2006

Posts: 1,625

Yek is on a distinguished road

Send a message via AIM to Yek Send a message via MSN to Yek Send a message via Yahoo to Yek Send a message via Skype™ to Yek
Default Re: Batch

what if there is a space in the filename?
Yek is offline  
Old 04-22-2007, 01:30 PM   #9 (permalink)
CrazeD's Avatar
 
Wizard Techie

Join Date: Feb 2006

Location: Maine

Posts: 3,682

CrazeD will become famous soon enough

Send a message via AIM to CrazeD Send a message via MSN to CrazeD
Default Re: Batch

Use quotes.

Example:

"C:\A Space\My Name Is Bob.exe"
__________________

Need website help? PM me!
CrazeD is offline  
Old 04-22-2007, 06:20 PM   #10 (permalink)
 
Monster Techie

Join Date: May 2004

Location: /usr/root/mn/us

Posts: 1,121

bla!! is on a distinguished road

Default Re: Batch

Code:
@echo off
"c:\program files\folder\file.exe"
Copy and paste that into a text file and rename it to whatever.bat
Then run it
__________________
<br>
Its a frigging Laptop, not a Labtop!!!!
bla!! is offline  
 
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch file steak1986 Windows Operating Systems and Software 6 04-11-2007 06:03 PM
Auto delete w/o prompt batch file Kratos Windows Operating Systems and Software 9 04-03-2007 03:18 PM