Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Change font color from commandline output, WScript.Echo.

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,39230
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Change font color from commandline output, WScript.Echo.
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Change font color from commandline output, WScript.Echo. - 10/27/2006 4:30:46 AM   
  buffalokml

 

Posts: 15
Score: 0
Joined: 4/3/2006
Status: offline
Hi All,

Below is my script to execute command line. Is there anyway that I could change font color when I write error message to console, WScript.Echo "Error:.... " & strCommand
(I want other color like red or yellow)?

Sub ExeCmd(strCommand)
'On Error Resume Next
Set objShell = CreateObject("WScript.Shell")
WScript.Echo "    "
WScript.Echo "Running command:  " & strCommand
strReturn = objShell.Run("cmd /c " & strCommand, 1, true)
if strReturn <> 0 then
   WScript.Echo "Error:.... " & strCommand
   ErrorLog("Error:.... " & strCommand)
   strFlag = false
else
WScript.Echo "************* Finished *****************"
WScript.Echo "    "
end if
End Sub

Best Regards,
 
 
Post #: 1
 
 RE: Change font color from commandline output, WScript.... - 10/28/2006 3:31:29 AM   
  kirrilian


Posts: 628
Score: 3
Joined: 3/15/2005
From:
Status: offline
I've looked for this myself and I haven't yet found a way to do it.

_____________________________

Have you searched here ?
VBScript Fundamentals
My Site

(in reply to buffalokml)
 
 
Post #: 2
 
 RE: Change font color from commandline output, WScript.... - 10/28/2006 6:43:18 AM   
  DiGiTAL.SkReAM


Posts: 1194
Score: 7
Joined: 9/6/2005
From: Florida, USA
Status: offline
The only way to accomplish functionality like this is by using IE as the display.


_____________________________

"Would you like to touch my monkey?" - Dieter (Mike Meyers)

"It is better to die like a tiger, than to live like a pussy."
-Master Wong, from Balls of Fury

(in reply to kirrilian)
 
 
Post #: 3
 
 RE: Change font color from commandline output, WScript.... - 10/30/2006 12:16:20 AM   
  ginolard


Posts: 1082
Score: 21
Joined: 8/10/2005
Status: offline
*cough* PowerShell *cough*

_____________________________

Author of ManagePC - http://managepc.net
AD Query Template - http://www.visualbasicscript.com/m_40609/tm.htm
Consolidated Scripting Framework - http://www.visualbasicscript.com/m_59109/tm.htm

(in reply to DiGiTAL.SkReAM)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Change font color from commandline output, WScript.Echo. Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts