- Batch Script Tutorial
- Batch Script Resources
- Selected Reading

Adding to the registry is done via the REG ADD command. Note that in order to add values to the registry you need to have sufficient privileges on the system to perform this operation.
Sep 03, 2020 Save your document as a batch file. If you haven't yet saved your document as a batch file, do the following: Click File, then click Save As. Type in your file's name followed by.bat (e.g., 'My Batch File' would become 'My Batch File.bat'). Click the 'Save as type' drop-down box, then click All Files. Select a save location, then click Save. You now have a batch file with the.bat file extension. Double-click it to run it. This particular batch file sets ECHO off (which cleans up the output by hiding the commands from being printed at the prompt, prints the text “Hello World” to the screen, and then waits for you to press a key before it ends. Cd command has not STDOUT.You probably need to append STDOUT of your batch file to a text file. Run your batch file from cmd: batchfile.bat 'C:UsersxasonDesktopLogslogs.txt' Or, inside your batch file. You can add switches to your script for different options, such as: /delete - to delete a mapped drive /persistent:yes/no - to reconnect the drive upon login. I personally leave it the way it is and just add one more line: del.bat. This way, I drop it in a user's startup folder and it will run once and that's it.
Syntax
The REG ADD command has the following variations. In the second variation, no name is specified for the key and it will add the name of “(Default)” for the key.

See All Results For This Question
Where
ValueName − The value, under the selected RegKey, to edit.
/d Data − The actual data to store as a 'String', integer, etc.
/f − Force an update without prompting 'Value exists, overwrite Y/N'.
/S Separator − Character to use as the separator in REG_MULTI_SZ values. The default is '0'.
/t DataType − These are the data types defined as per the registry standards which can be −
REG_SZ (default)
REG_DWORD
REG_EXPAND_SZ
REG_MULTI_SZ
Example

In the above example, the first part is to add a key into the registry under the location HKEY_CURRENT_USERConsole. This key will have a name of Test and the value assigned to the key will be Test Data which will be of the default string type.
What Commands Are Available In A Batch File?
The second command just displays what was added to the registry by using the REG QUERY command.
Batch File Add To Variable
Output
Batch File - How To Increment Variable Under DOS?

Following will be the output of the above program. The first line of the output shows that the ‘Add’ functionality was successful and the second output shows the inserted value into the registry.
Thank you for this info, but as Swaminathan.vp stated, once you have a vbs file it's best to just call it directly from the batch file. I assume then that the Yes / No button responses are specified within the batch file?
My main question is this: How do I display the red exclamation mark warning shield icon in the dialogue box (or any red exclamation mark) as well as being able to specify whether you want Yes/No, Ok/cancel, etc as it looks from what you've written above like you have to have one or the other, which I'm surely isn't the case. Also, the number you specified for 'Warning query icon' doesn't work...
Please could you supply a few examples of working batch file script that demonstrates a few of the possibilities, and how to apply actions for clicking on Yes/No, Ok/cancel, etc?