faster way to create batch files?

HeXen

Diamond Member
Dec 13, 2009
7,832
37
91
In notepad, i have to click "save as" then change file type to "all files" then add my ".bat" extension.

I want a notepad where i can just keyboard shortcut "save" and have it automatically save as a batch file.
How can i do this..any editor out there that would do that?
and no i don't want that .exe batch file converters, i need to type commands and just quickly save it to the batch file format. Gotta do a lot of them and need to cut out that tedious work.

thanks in advance.

*The long story: what i'm doing is making an HTPC box that can play console/arcade emulators. Rather than use a front end like GameEx, i'm specifically launching .zip files to open in an emulator and then use a .bat to .exe converter and creating my own Windows Shell to show off each game individually without regard to emulator that can be used via joystick or remote control.
Works well but it's a pain to manually "save as".
 
Oct 19, 2000
17,860
4
81
In notepad, i have to click "save as" then change file type to "all files" then add my ".bat" extension.

You don't have to change the file type to "all files", just type .bat at the end of the filename and it will save it with that extension. There's no need to change to "all files" unless you're wanting to see what all is in the folder you are saving in.
 

Netopia

Diamond Member
Oct 9, 1999
4,793
4
81
In notepad, just naming it with .bat often ends up with something.bat.txt

If you quote the name in notepad "something.bat" , then is will always save correctly.

But I think that Ampersand38 has the most elegant solution... just save all as text, open a command prompt, navigate to the directory and type:

ren *.txt *.bat

and you're done!
 

Netopia

Diamond Member
Oct 9, 1999
4,793
4
81
Oh, you could also start at a command prompt with:

copy con something.bat

type out your bat file and then hit ctrl-z to save it... but that's pretty old school (going back to stuff I did in the early 80's)
 

yinan

Golden Member
Jan 12, 2007
1,801
2
71
notepad c:\temp\script.cmd will also create the appropriately named file.
 

thewhat

Member
May 9, 2010
186
6
76
You don't have to change the file type to "all files", just type .bat at the end of the filename and it will save it with that extension. There's no need to change to "all files" unless you're wanting to see what all is in the folder you are saving in.
This is actually true, I tried it now. No need for quotes either.

But maybe it depends on some other settings. IIRC I had to switch to all files sometimes.
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
This is actually true, I tried it now. No need for quotes either.

But maybe it depends on some other settings. IIRC I had to switch to all files sometimes.

It depends on the "Hide extensions for known file types" check box in Folder options. If you uncheck that, then saving as pants.bat works. If you don't then saving pants.bat -> pants.bat.txt. Quotes is universal.
 

lxskllr

No Lifer
Nov 30, 2004
59,011
9,370
126
It depends on the "Hide extensions for known file types" check box in Folder options. If you uncheck that, then saving as pants.bat works. If you don't then saving pants.bat -> pants.bat.txt. Quotes is universal.

That's an unsafe setting. Extensions should always be visible, and If I were MS I'd remove the easy option to hide them. Make it a registry change to hide them for the 2 people who need that option for some reason.
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
That's an unsafe setting. Extensions should always be visible, and If I were MS I'd remove the easy option to hide them. Make it a registry change to hide them for the 2 people who need that option for some reason.

Um ok?
 

HeXen

Diamond Member
Dec 13, 2009
7,832
37
91
thanks guys.
I also found if i just hit cntrl+F then "A" key, it quickly takes me to the save as option, then type something.bat then "tab" and "A" key switches it to all files...after i did that a few times, i got pretty fast doing it that way. Also i started re using the same open notepad screen and just changing the name i need, so that saved me some time too.

Before i was opening new text, mouse over file and noticed no shortcut key for "save as" function, but i got it down now.
 
Last edited:
Oct 19, 2000
17,860
4
81
It depends on the "Hide extensions for known file types" check box in Folder options. If you uncheck that, then saving as pants.bat works. If you don't then saving pants.bat -> pants.bat.txt. Quotes is universal.

I disagree. Just tried on my W8 machine in the last minute, I have "Hide extensions for known file types" checked (which is the default). If I open a notepad, type some text, go to save the file and without changing anything, type test.bat, it saves as a batch file. I always have the same results on my W7 machine at work as well as numerous Server 2003 and 2008 servers.

I've never ran into an issue where saving as test.bat results in test.bat.txt.
 

imagoon

Diamond Member
Feb 19, 2003
5,199
0
0
I disagree. Just tried on my W8 machine in the last minute, I have "Hide extensions for known file types" checked (which is the default). If I open a notepad, type some text, go to save the file and without changing anything, type test.bat, it saves as a batch file. I always have the same results on my W7 machine at work as well as numerous Server 2003 and 2008 servers.

I've never ran into an issue where saving as test.bat results in test.bat.txt.

Say what you will but when you search for notepad .bat.txt you will find 587,000 webpages on google discussing everything from using quotes to making sure to set it to "all files" when saving or it will make it file.bat.txt.

I think there is more to triggering it that just hide extensions. I know it does it because it just happened to me today on one of my 2008R2 VMs. I need to unhide the extension and rename the file going through the "omg danger" prompt windows throws up about doing it.
 
Last edited: