HELP creating a .bat file

I'm trying to create a .bat file for the following command:

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.

ManieyaK_Citrix Systems / Network AdminAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

Vadim RappConnect With a Mentor Commented:
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

Vadim RappConnect With a Mentor Commented:
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:
remmett70Connect With a Mentor Commented:
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

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

ManieyaK_Citrix Systems / Network AdminAuthor Commented:
I copied & pasted the command in CMD got error see attachment.
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.
ManieyaK_Citrix Systems / Network AdminAuthor Commented:
Trying to make C:\Program Files\Symantec\BackUp Exec>bemcmd -o503 a .bat file please help.
Vadim RappCommented:
"C:\Program Files\Symantec\BackUp Exec\bemcmd.exe" -o503

save this line as .bat file, same as above.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.