Solved

How to create a .bat file from a .txt file

Posted on 2013-01-26
3
1,021 Views
Last Modified: 2013-01-26
I am used to creating a batch file by merely changing the extension on the text file from .txt to .bat.  However, on our new Windows Server 2008 this is not working. The name on the file is now TEST.bat but it opens as a text file. Looking at the properties of file I see that the name is TEST.bat.txt which explains what is going on. How can I change the name so that it only TEST.bat?
0
Comment
Question by:gbm33
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 10

Accepted Solution

by:
acbxyz earned 500 total points
ID: 38822865
By default windows hides extensions for known file types, such as txt.
You can disable this in Folder Options.

If you don't want to, if you save with notepad as test.bat it won't add another .txt.
Another way is to use the command line: "mv test.txt test.bat"
0
 
LVL 94

Expert Comment

by:John Hurst
ID: 38822866
Open Notepad with Run as Administrator, open the file, and the save as text.bat. Check to see that it saved properly. This is likely an authority issue with UAC.

.... Thinkpads_User
0
 
LVL 43

Expert Comment

by:Steve Knight
ID: 38822975
much easier... when in notepad when you save-as choose 'all files' in the type box not text files (.txt).

steve
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Scenario:  You do full backups to a internal hard drive in either product (SBS or Server 2008).  All goes well for a very long time.  One day, backups begin to fail with a message that the disk is full.  Your disk contains many, many more backups th…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question