Solved

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

Posted on 2013-01-26
3
959 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
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 90

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

To effectively work with Diskpart on a Server Core, it is necessary to write some small batch script's, because you can't execute diskpart in a remote powershell session. To get startet, place the Diskpart batch script's into a share on your loca…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

746 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now