poly4life Posted March 24, 2011 Posted March 24, 2011 Hello,If you're familiar with Perl, it has a feature where you can run it in single line edit mode, which allows you to write the code out all in one line, instead of calling my_script.vbs, for example. Is there a way I can just execute code in a similar single line edit mode, to avoid calling an external file? I just want to write out a msgbox that displays to the user from a batch, and it seems unnecessary to create another file which just has "msgbox...". I'm open to other suggestions, if there's a way to have a pop-up window display to the user directly from a batch without using an external language like vbscript.Thank you.Update: I did find this site that has been of great help --> http://www.robvanderwoude.com/usermessages.phpI took this bit of code here:> usermessage.vbs ECHO WScript.Echoˆ( "Multiple lines?" ˆ& vbCrLf ˆ& "OK..." ˆ)WSCRIPT.EXE usermessage.vbsDEL usermessage.vbsAnd it works fine, but I was hoping to do something like this (pseudo-code):WSCRIPT.EXE "WSCRIPT.Echo('This is pseudo code, to show I want to display a msgbox without calling an external script.')"
CoffeeFiend Posted March 24, 2011 Posted March 24, 2011 from a batch without using an external language like vbscript.Batch files don't do GUI, it's tech from the 1980's. vbscript, a far more modern (then again, we now have powershell too) and powerful tech can though. Your best bet is getting rid of the batch file part, and just using vbscript. Whatever the batch file does, vbscript (and pretty much any other scripting language) can easily do as well. Even using something external from a batch file (to popup a messagebox or similar) is kind of a pain anyway (e.g. getting result using errorlevel)
dencorso Posted March 24, 2011 Posted March 24, 2011 While I do agree with CoffeeFiend, *the* external command to have at hand, in case you wish to stick to a .cmd/.bat is NirSoft's nircmd, which is useful for much more than that.
poly4life Posted March 24, 2011 Author Posted March 24, 2011 Thank you both. I like that nircmd program. I think I'll look into porting over the batch code to powershell or vbs, instead of "putting the square peg in the round hole". Thanks again.
Yzöwl Posted March 24, 2011 Posted March 24, 2011 I'm not sure that I fully understand what your intention is. However from my understanding it is possible to display a message box from the batch file without undertaking the process of creating a vbscript, running it, then deleting it.
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now