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: Simple .bat question

09 Mar 2013   #1
Simon001

windows 7 home premium x64 service pack 1
 
 
Simple .bat question

Hi all,
Does anybody happen to know what command I should be using in a batch file to open a file with a program other than the default for that extension? Or alternatively, as a workaround, how to set the default for a given extension in a batch file and then set it back again?
Specifically I'm working with a program that has multiple .cfg files for when I'm doing various things, so I'm trying to make batch files to open the appropriate one at the appropriate time but want to leave notepad as the default program to open them for ease of editing.
Thanks,
Simon


My System SpecsSystem Spec
.

09 Mar 2013   #2
Brink
Microsoft MVP

64-bit Windows 10 Pro
 
 

Hello Simon, and welcome to Seven Forums.

You could use this in the BAT file to open a file with a supported program of your choice.

start "Full path to .exe of program" "Full path of file with extension"


For example, to open a .txt file in Wordpad.

start "C:\Windows\write.exe" "C:\Users\(user-name)\My Documents\My text file.txt"


Hope this helps,
Shawn
My System SpecsSystem Spec
09 Mar 2013   #3
Simon001

windows 7 home premium x64 service pack 1
 
 

That's great, thank you very much.
My System SpecsSystem Spec
.


09 Mar 2013   #4
Brink
Microsoft MVP

64-bit Windows 10 Pro
 
 

You're most welcome Simon.
My System SpecsSystem Spec
Reply

 Simple .bat question




Thread Tools





Similar help and support threads
Thread Forum
Just a simple question about my RAM
Hello, I was wondering if this stats are good. I have 4GB ram DDR2 installed and before i had a issue with 3.19 avaiable ( thats fixed ). Now i was wondering if those stats are good: http://i51.photobucket.com/albums/f356/addpowerpeeps/Destop01_zpsa35fefc9.png Friendly Kinds,
Performance & Maintenance
Simple question .
I have a dell xps one a2420 computer that I am truly not trying to part with as of yet, is the motherdoard upgradeable?
General Discussion
Really simple question
Hello everyone. I am a newcomer to the W7 forum and would really appreciate an answer to the following question. Currently I'm using Windows Vista Home Edition which I do not like. I am going to upgrade to W7 Home Edition (clean install) but I'm confused as to which version of W7 to get. There...
General Discussion
Simple question
Ok, I am going to start out by saying I have no idea when it comes to computers what all is going on. So, my problem is I am having random BSODs, and my question is how can I view what the problem causing them is, and what should I do from there?
BSOD Help and Support
Please help ,e with this simple question!!
Can anybody help me?! A very simple question I guess ... When you are surfing the net and you are asked for your email / password / name, whatever, you click with the mouse where you want to type and as soon as you put in one letter, below appears a sort of memory list with all previous words you...
Performance & Maintenance
simple question
I'm having trouble with snaping to the right ( it puts the image beyond the screen) when I looked in the device manager it shows 2 moniters in the drop down. I only have one moniter though. could this be the issue. thanks
General Discussion

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 10:15.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App