Solved

HELP creating a .bat file

Posted on 2013-05-10
7
488 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 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This is about my first experience with programming Arduino.
Part One of the two-part Q&A series with MalwareTech.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…
Simple Linear Regression
Suggested Courses

624 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