Ask Sawal

Discussion Forum
Notification Icon1
Write Answer Icon
Add Question Icon

How to echo in vbscript?

2 Answer(s) Available
Answer # 1 #
  • Open a command window and change the directory to the path of the script.
  • Submit the query by entering, at the command-line prompt, cscript vbscript.vbs.
[2]
Edit
Query
Report
Siddhartha Bist
Postal Service Mail Carriers
Answer # 2 #

The purpose of the WSH pop-up message is to let you know that the script has completed successfully.  It can also give you valuable extra information, for instance, the number of objects created, and the container where they are ‘born’.

This is a very basic script, which fits with my aim to start simply.

Prerequisites

This script is suitable for most Windows clients going right back to XP, W2K, even NT 4.0 and Win 9x.

Instructions for Creating your WMI Script

If we use the script below as our ‘vehicle’ then we can experiment with WScript.Echo messages to confirm that the script worked properly.

What the script does is to create ten users in an OU called BulkGuy.  It should work in any domain.  If you do not have a domain available then adapt the WSCript.echo method to a simpler script.

Note 1: It is the command .Echo that WScript actually uses to produces a message box. WScript.quit has a very different meaning.

I like thePermissions Monitor because it enables me to see quickly WHO has permissions to do WHAT.  When you launch this tool it analyzes a users effective NTFS permissions for a specific file or folder, takes into account network share access, then displays the results in a nifty desktop dashboard!

Think of all the frustration that this free utility saves when you are troubleshooting authorization problems for users access to a resource.  Give this permissions monitor a try – it’s free!

Download Permissions Analyser – Free Active Directory Tool

Note 1:  The key is to have the intUser variable  inside the For….Next loop

Note 2:  To join the variable with the string use ampersand (&) not plus.  This method is called concatenation.

Note 3:  The space between the speech marks and the 10 is trivial item, but it improves readability.

• WMI Tutorial   • Win32_Process   • WMI Memory   • WMI Basics   • Free Download of WMI Monitor

• WMI VBS   • VBScript Services   • WMI Disks   • WMI Physical Disks

[1]
Edit
Query
Report
xyppcqij Ames
CRUSHER TENDER