Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 492
  • Last Modified:

HELP creating a .bat file

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
ManieyaK_
Asked:
ManieyaK_
  • 3
  • 2
  • 2
3 Solutions
 
Vadim RappCommented:
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
 
remmett70Commented:
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
 
ManieyaK_Citrix Systems / Network AdminAuthor Commented:
I copied & pasted the command in CMD got error see attachment.
Error.png
0
Independent Software Vendors: 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!

 
Vadim RappCommented:
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
 
remmett70Commented:
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
 
ManieyaK_Citrix Systems / Network AdminAuthor Commented:
Trying to make C:\Program Files\Symantec\BackUp Exec>bemcmd -o503 a .bat file please help.
0
 
Vadim RappCommented:
"C:\Program Files\Symantec\BackUp Exec\bemcmd.exe" -o503

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

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now