Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

cmd.bat


  • Please log in to reply
12 replies to this topic

#1 patbox

patbox

  • Members
  • 456 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:26 AM

Posted 15 February 2009 - 09:08 AM

I use Command Prompt quite often and got tired of the layout. So I just did a very simple CMD.bat that makes it look a bit better:

1) Open Notepad

2) Copy the following in the text:
title CMD WELCOME 1.0
color f9
cd \
cmd /k cls


3) Save As and type CMB.BAT. You can run it from Desktop, or Quick Start, or put it to Start Menu.

That is my CMD Welcome 1.0. It is no Star Wars, but it makes life a bit nicer. Post any ideea how to make it even nicer. :-)
Message from Patbox: I AM LOOKING FOR A GIRLFRIEND (PM if interested) :-)

BC AdBot (Login to Remove)

 


#2 ާyh

ާyh

  • Members
  • 6 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Manchester
  • Local time:02:26 AM

Posted 19 February 2009 - 05:20 AM

NOTE: Using Vista 64-bit

I tried this and it worked the first time saving the file as CMD.bat
Then I tried to move the file and it said windows couldn't find it even though I right clicked and cut on the file. The command line couldn't see the file at all. I thought I'd got round it by:
right click -> edit, notepad starts up and says Cannot find the file, do you want to craete a new file.
So I did and then deleted it, but when I search for the file name it still finds it (or at least the shortcut). Even after changing the filename and the extension back to .txt this still happens. Any ideas how to be rid of this?

By the way I like your tip and made another one called cmd.cmd instead

#3 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,250 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:06:26 PM

Posted 19 February 2009 - 02:11 PM

Even more fun:

First, rename the batch file to something like cmd1.bat orcmd1.cmd)

Now move your cmd1.bat or cmd1.cmd file to X:\WINDOWS\system32 (where X is the drive letter with Windows on it) and you can launch it from the Run... box by simply typing cmd1.

#4 uByte

uByte

  • Members
  • 243 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:FL
  • Local time:09:26 PM

Posted 19 February 2009 - 07:15 PM

cool batch!

uByte

#5 patbox

patbox
  • Topic Starter

  • Members
  • 456 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:26 AM

Posted 20 February 2009 - 05:51 PM

Andrew what exactly is the difference between *.bat and *.cmd? Does that work exactly the same way? I.e. there's no difference?
Message from Patbox: I AM LOOKING FOR A GIRLFRIEND (PM if interested) :-)

#6 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,250 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:06:26 PM

Posted 20 February 2009 - 06:13 PM

No difference except that .cmd and .bat files are recognized by Windows 2000 and higher whereas older versions only recognized .bat. I don't know why.

#7 patbox

patbox
  • Topic Starter

  • Members
  • 456 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:26 AM

Posted 20 February 2009 - 06:52 PM

Andrew, is there a way how to assign an additional folder to be automatically linked to start/run? E.g. I could save my bat or cmd files in D:/CMD, and I would want this folder to be linked to start/run so that I could just write the name of the files there? :thumbsup:
Message from Patbox: I AM LOOKING FOR A GIRLFRIEND (PM if interested) :-)

#8 patbox

patbox
  • Topic Starter

  • Members
  • 456 posts
  • OFFLINE
  •  
  • Gender:Male
  • Local time:02:26 AM

Posted 20 February 2009 - 07:29 PM

I have significantly improved the Welcome CMD batch.

1. Copy the following into notepad:

@title WELCOME CMD 2.0
@color f9
@iF "%1" == "blue" color 1f
@if "%1" == "red" color 4f
@if "%1" == "green" color 2f
@cd \
@cls
@if "%1" == "" cmd /k echo WELCOME CMD 2.0
@if not "%1" == "" cmd /k echo WELCOME CMD 2.0 (%1)



2. Save it as wcmd.bat and put it to the following folder C:\WINDOWS\system32


3. Go to Start/Run and type

wcmd

or

wcmd blue

or

wcmd red

or

wcmd green


This will give you a better CMD experience with cool colors.

:thumbsup:
Message from Patbox: I AM LOOKING FOR A GIRLFRIEND (PM if interested) :-)

#9 Andrew

Andrew

    Bleepin' Night Watchman


  • Moderator
  • 8,250 posts
  • OFFLINE
  •  
  • Gender:Not Telling
  • Location:Right behind you
  • Local time:06:26 PM

Posted 21 February 2009 - 12:46 PM

Andrew, is there a way how to assign an additional folder to be automatically linked to start/run? E.g. I could save my bat or cmd files in D:/CMD, and I would want this folder to be linked to start/run so that I could just write the name of the files there? :thumbsup:


Yes there is!

There are two ways to add a directory to the predefined Environment Variables. One is temporary and one isn't.

First Method:
This method will add a directory to the Environment Variables only for the duration of the existing command shell (that is, when you open a command line window, you set the path which will expire when you close the command line window.)
1. Open a command line window by clicking on Start->Run... and typing cmd or command and pressing Enter.
2. At the prompt, type your new path variable in the following format:
set mypath=C:\foobar


A new Environment Variable will be added called "mypath" and it will point to the directory "C:\foobar". The path can now be called by using the following format:

%mypath%


This can be used in a file address, for example:
%mypath%\document1.doc


instructs the computer to access the file located at C:\foobar\document1.doc

As you can see, this does not make it so Windows will automatically looks in %mypath% when you type a command or filename as it does with C:\Windows\system32 and a few others. To do that, proceed to the next method.

Second method:
This method allows you to make custom system paths which are permanent as well as to edit existing system paths. Be extremely careful when editing existing entries!!!
1. Right-click on My Computer and select Properties.
2. Click on the Advanced tab in the System Properties dialog
Posted Image

3. Click on the Environment Variables button. You will see this window:
Posted Image
There are two types of variables, as you can see: User and System. User variables are available only to you, the logged on user. System variables are available to all users.

4. You can use the New button to create new environment variables just like the one you made in method one, but permanent. To add a directory to the list of directories that windows will look in when you type an unqualified command or filename (as you asked) you want to edit the Path variable in the System Variables list. Select the Path variable and click the Edit button. You should notice that several different directories are listed, each separated by a semicolon (;)
Posted Image

These are the directories that Windows will search to find the command you entered. It will search them in order from left to right until it finds a matching file or command. If you want Windows to search you custom directory first, place it at the beginning (left) of the list, otherwise put it at the end (right, and recommended) of the list.

Click OK, OK, and OK again. you shouldn't need to restart for it to take effect.

Edited by Amazing Andrew, 21 February 2009 - 12:49 PM.


#10 Gstick

Gstick

  • Members
  • 53 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Canada
  • Local time:09:26 PM

Posted 22 February 2009 - 02:30 PM

This is a "dark" version of the file, all credit goes to patbox.
@title WELCOME CMD 2.1@color 8f@iF "%1" == "blue" color 0b@if "%1" == "red" color 0c@if "%1" == "green" color 0a@if "%1" == "purple" color 0d@if "%1" == "yellow" color 0e@cd \@cls@if "%1" == "" cmd /k echo WELCOME CMD 2.1@if not "%1" == "" cmd /k echo WELCOME CMD 2.1 (%1)

Edited by Gstick, 22 February 2009 - 02:33 PM.

"I'm not dumb. I just have a command of thoroughly useless information."


#11 awesome dude

awesome dude

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Local time:09:26 PM

Posted 14 August 2013 - 10:26 AM

I use Command Prompt quite often and got tired of the layout. So I just did a very simple CMD.bat that makes it look a bit better:

1) Open Notepad

2) Copy the following in the text:
title CMD WELCOME 1.0
color f9
cd \
cmd /k cls


3) Save As and type CMB.BAT. You can run it from Desktop, or Quick Start, or put it to Start Menu.

That is my CMD Welcome 1.0. It is no Star Wars, but it makes life a bit nicer. Post any ideea how to make it even nicer. :-)

hey found an awesome one ok pput in this code

title CMD WELCOME 1.0
color 957
cd \
cmd /k cls

 what 957 does you can choose and y color you want at the begging


Edited by awesome dude, 14 August 2013 - 10:26 AM.


#12 awesome dude

awesome dude

  • Members
  • 2 posts
  • OFFLINE
  •  
  • Local time:09:26 PM

Posted 14 August 2013 - 10:35 AM

This is a "dark" version of the file, all credit goes to patbox.

@title WELCOME CMD 2.1@color 8f@iF "%1" == "blue" color 0b@if "%1" == "red" color 0c@if "%1" == "green" color 0a@if "%1" == "purple" color 0d@if "%1" == "yellow" color 0e@cd \@cls@if "%1" == "" cmd /k echo WELCOME CMD 2.1@if not "%1" == "" cmd /k echo WELCOME CMD 2.1 (%1)

it didnt work for mee



#13 JohnnyJammer

JohnnyJammer

  • Members
  • 1,114 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:QLD Australia
  • Local time:11:26 AM

Posted 14 November 2013 - 01:11 AM

I know its a late post and probably irellivant but i open cmd, then type wmic and hit neter and then hold the Windows key and press the Up key to make the dos screen to maxed window mode, then i type exit and i have a full dos screen to execute long commands into and view the results.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users