Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

HELP creating a .bat file

Posted on 2013-05-10
7
Medium Priority
?
490 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_
[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
  • 2
  • 2
7 Comments
 
LVL 40

Assisted Solution

by:Vadim Rapp
Vadim Rapp earned 1336 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 664 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 40

Accepted Solution

by:
Vadim Rapp earned 1336 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Monitor input from a computer is usually nothing special.  In this instance it prevented anyone from using the computer.  This was a preconfiguration that didn't work.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Progress

730 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