473,485 Members | 1,397 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to display a message in console window?

<package>
<job id="js">
<script language="JScript">
var WshNetwork = WScript.CreateObject("WScript.Network");
var oDrives = WshNetwork.EnumNetworkDrives();
var oPrinters = WshNetwork.EnumPrinterConnections();
WScript.Echo("Domain = " + WshNetwork.UserDomain);
WScript.Echo("Computer Name = " + WshNetwork.ComputerName);
WScript.Echo("User Name = " + WshNetwork.UserName);
WScript.Echo();
WScript.Echo("Network drive mappings:");
for(i=0; i<oDrives.Count(); i+=2){
WScript.Echo("Drive " + oDrives.Item(i) + " = " +
oDrives.Item(i+1));
}
WScript.Echo();
WScript.Echo("Network printer mappings:");
for(i=0; i<oPrinters.Count(); i+=2){
WScript.Echo("Port " + oPrinters.Item(i) + " = " +
oPrinters.Item(i+1));
}
</script>
</job>
</package>

find an example in msdn, but it displays the message in messagebox not
in console window

Jan 18 '06 #1
5 18579
thinktwice wrote:
<package>
<job id="js">
<script language="JScript"> <snip> </script>
</job>
</package>

find an example in msdn, but it displays the message in
messagebox not in console window


Are you running it with WScript.exe or CScript.exe? CScript.exe should
echo to the console window.

Richard.
Jan 18 '06 #2
i call it in bat file,
like this :
cmd CScript /k C:\test.wsf

Jan 18 '06 #3
I'm kinda intermediate with Javascript, what is this type of syntax
referencing to?

Jan 18 '06 #4
thinktwice wrote:
i call it in bat file,
like this :
cmd CScript /k C:\test.wsf


The - cmd - command starts another instance of the command interpreter
process, but it does not open a console window for that process. If it
did open a new console window then it would be to that window that echo
would write, but as there is no console window popping up message boxes
is probably what Microsoft see as the best alternative (especially given
that CScript has a switch to turn off message output for batch file
use).

If you execute:-

CScript C:\test.wsf

- in a batch file (or literally in the console window) echo does write
to that window.

Richard.
Jan 21 '06 #5
thanks Richard, it works

Jan 25 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4430
by: Jason Callas | last post by:
I am trying to figure out how to create a console window but cannot figure out how to do this. I know it can be done since the C# and VB console template projects do this but I see no code on how...
2
3049
by: Ram | last post by:
I have a console application that brings up a dialog if invoked with no command line parameters. If I double click on my application a console window is briefly displayed before the dialog appears...
5
4747
by: phickman | last post by:
Hi all. After several searches using Google, I had just about given up on finding a way to clear the console Window. After spending the past week learning assembly language and writing a small...
11
4832
by: objectref | last post by:
Hi to all, i have a window app and i want to display some info in a console window. I figured out (after a very long search...) how am i supposed to do it and i try using the following code. ...
1
1495
by: Marty | last post by:
Hi, I have a DLL that display message in the Console window. My program was previously compiled as a console project and the output was readable from the shell/dos window. Now that my project...
0
4660
by: Mythran | last post by:
I can draw onto the console window where I want using a mixture of API calls and the System.Drawing namespace (.Net 1.1). I am trying to install hooks for the window to catch a resize or another...
1
7418
by: Josh | last post by:
Iv created a program that has many command-line arguments. I want to beable to display help information in the console window that the person typed the command into. I cant do this unless I switch...
10
6285
by: Stephany Young | last post by:
When one uses the System.Diagnostics.Process.Start method to launch a common or garden Console application, one can set the WindowStyle property of the StartInfo object to ProcessWindowStyle.Hidden...
3
1366
by: =?Utf-8?B?VGVycmFuY2U=?= | last post by:
Good Afternoon: I have two questions I was hoping someone can help me with. 1. I've created a app that creates a xml file; the project was constructed as a console window. I want to know is...
0
7090
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7116
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7275
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4857
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3058
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3063
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1376
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
595
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.