?
Solved

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

Posted on 2013-01-26
3
Medium Priority
?
1,100 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 2000 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 97

Expert Comment

by:Experienced Member
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

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...
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Suggested Courses

800 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