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.

CScript vs WScript

Featured Replies

Hi,

I am currently writing some command line tools and was wondering what the most portable way of having a script called myscript.vbs that works like any normal command line program.

I have tried so far testing for the name of the script host executable and if it's wscript, then doing in an if block

shell.run "cscript.exe """ & Wscript.ScriptFullName & """"
WScript.Quit

However this opens the script in a new cmd window which is a bit of a problem, especially since you can't read the output before the window closes.

I know I can change the default scripting host of the system to be cscript instead of wscript but it would be nice to do this in a more portable way such that I don't have to change the host environment to achieve this.

Also, if I change the scripting host, then whenever I run any wscript orientated script that I want to run behind the scenes, it pops up a cmd box, which looks rubbish.

Perhaps there is a way of doing the shell.run in the current window or some completely different way of doing this? shell.Exec? Or get cscript to execute in the current window instead of starting a new one?

Any ideas welcome.

Thanks

if you use ExeScript to compile your vbs to an exe you should get the predictable results you're looking for.

Edited by #rootworm

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.