• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 493
  • 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
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
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

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.

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