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
Solved

HELP creating a .bat file

Posted on 2013-05-10
7
485 Views
Last Modified: 2013-06-19
I'm trying to create a .bat file for the following command:
C:\WMIC BIOS GET SERIALNUMBER

I'm confused on how to do this please point me in the right direction for learning how to create more complex .bat files in the future.

Thanks.
0
Comment
Question by:ManieyaK_
  • 3
  • 2
  • 2
7 Comments
 
LVL 40

Assisted Solution

by:Vadim Rapp
Vadim Rapp earned 334 total points
ID: 39155669
open notepad
paste the command
save as mycommand.bat, or mycommand.cmd (in "save as" dialog, select "all files" from the dropdown, otherwise it will save as mycommand.bat.txt)

Here's tutorial:
http://www.wikihow.com/Write-a-Batch-File
0
 
LVL 10

Assisted Solution

by:remmett70
remmett70 earned 166 total points
ID: 39155670
What are you trying to do?  The more complex you get, the more I would look at VBS and Powershell.

You can output to a text file like this?

you don't need to specify C:\ in the batch file.
wmic bios get serialnumber > .\serialnumber.txt

Open in new window

0
 

Author Comment

by:ManieyaK_
ID: 39156357
I copied & pasted the command in CMD got error see attachment.
Error.png
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 334 total points
ID: 39156481
the command you posted in your question was c:\wmic, thich means that you are running file c:\wmic.exe . If this file does not exist, or is located elsewhere, adjust the command accordingly. Most likely you can simply remove C:\ , i.e. leave it as

WMIC BIOS GET SERIALNUMBER
0
 
LVL 10

Expert Comment

by:remmett70
ID: 39156521
Your error is because you have C:\.  When you put that, you are saying the .exe is located at the root of your C: drive.  Take the C:\ away, and the system will look for the file in known locations.
0
 

Author Comment

by:ManieyaK_
ID: 39259243
Trying to make C:\Program Files\Symantec\BackUp Exec>bemcmd -o503 a .bat file please help.
0
 
LVL 40

Expert Comment

by:Vadim Rapp
ID: 39259881
"C:\Program Files\Symantec\BackUp Exec\bemcmd.exe" -o503

save this line as .bat file, same as above.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
problem Installing .net framework 4.5.2 8 71
how to export this list 4 59
ejb stateless example 2 18
Eclipse Java import and method not resolved 4 47
Ever notice how you can't use a new drive in Windows without having Windows assigning a Disk Signature?  Ever have a signature collision problem (especially with Virtual Machines?)  This article is intended to help you understand what's going on and…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

809 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