Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Can I write a single line cscript/wscript, a la perl, instead of calli

Featured Replies

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.php

I took this bit of code here:


> usermessage.vbs ECHO WScript.Echoˆ( "Multiple lines?" ˆ& vbCrLf ˆ& "OK..." ˆ)
WSCRIPT.EXE usermessage.vbs
DEL usermessage.vbs

And 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.')"


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)

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.

  • Author

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.

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.

Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.