I'm kind of going through DOS again and it's been ages, so I need a lot of help.
My question is; how can I make a batch file open a popup screen? Like:
Sorry for the poor English, I'm Dutch/Italian >.<
I'm kind of going through DOS again and it's been ages, so I need a lot of help.
My question is; how can I make a batch file open a popup screen? Like:
Sorry for the poor English, I'm Dutch/Italian >.<
You can't, not unless you have a small program that displays a messagebox and run that.
You could open a console window that displays a prompt though, but getting a GUI message box is not possible, AFAIK.
I would make a very simple VBScript file and call it using CScript to parse the command line parameters.
Something like the following saved in MessageBox.vbs:
Set objArgs = WScript.Arguments
messageText = objArgs(0)
MsgBox messageText
Which you would call like:
cscript MessageBox.vbs "This will be shown in a popup."
MsgBox reference if you are interested in going this route.
First of all, DOS has nothing to do with it, you probably want a Windows command line solution (again: no DOS, pure Windows, just not a Window, but a Console).
You can either use the VBScript method provided by boflynn or you can mis-use net send
or msg
:
net send localhost Some message to display
for old versions of Windows. This does depend on the Messenger service to run, though.
msg "%username%" Some message to display
for newer versions (XP and onward, apparently).
This will pop-up another Command Prompt window:
START CMD /C "ECHO My Popup Message && PAUSE"
Try :
Msg * "insert your message here"
If you are using Windows XP's command.com, this will open a message box.
Opening a new cmd window isn't quite what you were asking for, I gather. You could also use VBScript, and use this with your .bat file. You would open it from the bat file with this command:
cd C:\"location of vbscript"
What this does is change the directory command.com will search for files from, then on the next line:
"insert name of your vbscript here".vbs
Then you create a new Notepad document, type in
<script type="text/vbscript">
MsgBox "your text here"
</script>
You would then save this as a .vbs file (by putting ".vbs" at the end of the filename), save as "All Files" in the drop down box below the file name (so it doesn't save as .txt), then click Save ^_^
(Apologies if I got that wrong, my VBScript is a little rusty xD)
If you have any queries with this, just ask at [email protected]. (Note it may take a while for a response, I check my e-mail once a day.)
I use a utility named msgbox.exe from here: http://www.paulsadowski.com/WSH/cmdprogs.htm