Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


VBScript - Control //NOLOGO from within script?

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> VBScript - Control //NOLOGO from within script?
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 VBScript - Control //NOLOGO from within script? - 1/10/2008 11:28:30 PM   
  humbletech99

 

Posts: 53
Score: 0
Joined: 6/9/2007
Status: offline
I'd like the ability to switch off the stupid logo from within my scripts just for their own execution. Having to tell people to do //nologo is lame and I am not going to go around to all my servers or someone else's servers to do cscript //nologo //s on all of them.

Is there a way to switch off the logo from within a script, that same way you can set a timeout from within the script?

Given that the self setting of Timeout seemed to be an undocumented feature over at Microsoft, I'd really like to know if the same is true for NOLOGO.

_____________________________

value(geeks) > value(mundanes)
 
 
Post #: 1
 
 RE: VBScript - Control //NOLOGO from within script? - 1/10/2008 11:59:21 PM   
  centauricw

 

Posts: 10
Score: 0
Joined: 2/20/2006
Status: offline
As far as I know, there is no way to shut off the logo from inside a VBScript snice this is printed by the scripting engine before it starts executing the script.  However, there is a easy workaround.  Simply create a command script with the same name (i.e. myvbscript.cmd)  and include the following:


      

If you run the script from a command prompt without using an extension (i.e. myvbscript), Windows will choose the CMD file over the VBS file when running the script.

Regards,

(in reply to humbletech99)
 
 
Post #: 2
 
 RE: VBScript - Control //NOLOGO from within script? - 1/11/2008 12:13:11 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi humbletech99,

see this log of a session:


      

Hoping that you don't have too many computers to do "cscript //nologo //s" on
or an eager assistent!

ehvbs

[Challenge: Is this documented in the VBScript Docs and if yes, how would
you search for it?]

(in reply to centauricw)
 
 
Post #: 3
 
 RE: VBScript - Control //NOLOGO from within script? - 1/11/2008 12:18:53 AM   
  humbletech99

 

Posts: 53
Score: 0
Joined: 6/9/2007
Status: offline
I specifically mentioned that I don't consider having to do "cscript //NOLOGO //S" to be a solution.

I could use a batch if it was just me but this makes it less nice to distribute among machines and if I give the script to someone I have to give 2 files. Also, the batch you showed doesn't activate it if the vbs is not in the path or the local directory.

I can't use batch as a solution either.

I need a way of fixing this within the script itself, something like

      
Of course, I've tried this and similar but not found the magic yet...

_____________________________

value(geeks) > value(mundanes)

(in reply to ehvbs)
 
 
Post #: 4
 
 RE: VBScript - Control //NOLOGO from within script? - 1/11/2008 12:24:15 AM   
  ehvbs

 

Posts: 2173
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi humbletech99,

sorry, I didn't read carefully enough. Please accept my apology.

Regards

ehvbs

(in reply to humbletech99)
 
 
Post #: 5
 
 RE: VBScript - Control //NOLOGO from within script? - 1/11/2008 11:32:18 AM   
  TNO


Posts: 1247
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
hmm...

All I can think of at the moment is a .wsh file:

quote:

[ScriptFile]
Path=C:\Users\-TNO-\Desktop\test7.vbs
[Options]
Timeout=0
DisplayLogo=0



But of course thats 2 files now as well.

There is no way within the script to run with no logo like you can with timeout (I checked with an object browser with WSH 5.7)

A possible alternative to have only 1 file is creating a non graphical hta to do the work instead of a vbs file. A little more wrapper work obviously, but its just 1 file.

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to ehvbs)
 
 
Post #: 6
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 12:10:10 AM   
  ebgreen


Posts: 4971
Score: 31
Joined: 7/12/2005
Status: offline
The real problem is that you want to change the startup behavior of the interpreter from a script that the interpreter has to start up to run. Unless your script is capable of time travel, there is no way for it to go back and tell the interpreter that is should not have started with the logo.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to TNO)
 
 
Post #: 7
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 2:59:00 AM   
  humbletech99

 

Posts: 53
Score: 0
Joined: 6/9/2007
Status: offline
yes I know, I know. Perhaps the best I can do is run "cscript //nologo //s" from within the script so the next time it doesn't get the logo...

_____________________________

value(geeks) > value(mundanes)

(in reply to ebgreen)
 
 
Post #: 8
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 4:18:11 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
How is the executable which is getting information from the vbscript receiving the information.
Is it through a pipe or console redirection ? Also is the executable launching the application?

_____________________________

Rischip
Author of - The Grim Linker

(in reply to humbletech99)
 
 
Post #: 9
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 4:22:35 AM   
  humbletech99

 

Posts: 53
Score: 0
Joined: 6/9/2007
Status: offline
yes it is launching the app, but I don't want the app to be responsible for setting //nologo if I can help it. I also don't want any user I give this to have to do this either so I feel that the cscript //nologo for the second run is the best trade off...

_____________________________

value(geeks) > value(mundanes)

(in reply to Rischip)
 
 
Post #: 10
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 4:25:30 AM   
  ebgreen


Posts: 4971
Score: 31
Joined: 7/12/2005
Status: offline
I normally try to avoid carrying on the same discussion in multiple fora, but:

Just to further the discussion, I would not be terribly happy if someone gave me a script to run and it globally changed the way that all my scripts functioned from then on.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to humbletech99)
 
 
Post #: 11
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 4:39:08 AM   
  humbletech99

 

Posts: 53
Score: 0
Joined: 6/9/2007
Status: offline
yes I had considered this but come on, who wants to have the stupid thing displaying all the time?

Perhaps I'll add this with a switch...

Thanks for the note, I'll revise this and make it a switch now instead.

_____________________________

value(geeks) > value(mundanes)

(in reply to ebgreen)
 
 
Post #: 12
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 4:58:53 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
humbletech99,
Please don't assume that you can read my mind.
I do not believe I made the suggestion that the executable launch using the //NoLogo switch.
I was collecting information. As a matter of fact my post made no mention of the //NoLogo switch.
Now if would answer the questions that I actually did ask, then we could proceed.
If you would rather assume, then I will bow out.

_____________________________

Rischip
Author of - The Grim Linker

(in reply to humbletech99)
 
 
Post #: 13
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 5:03:23 AM   
  humbletech99

 

Posts: 53
Score: 0
Joined: 6/9/2007
Status: offline
Rischip, cool down. I did try to answer, the executable is launching the app, dunno the internals but what I do know is that it is getting the standard output but it does not collect the standard error by design. I don't believe that the executable is using a pipe. It is launching and catching the output, so I guess a redirection? There is no cmd shell so I'm not sure that "redirection" is the right thing?

_____________________________

value(geeks) > value(mundanes)

(in reply to Rischip)
 
 
Post #: 14
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 5:13:25 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
So the app is launching the script and reading the output.
It is reading 1 single line of output which is why the logo messes things up.

The output is read in a way which would be similar launching a script using app = shell.exec and reading in app.stdout ?
If you were doing this in vbscript?

_____________________________

Rischip
Author of - The Grim Linker

(in reply to humbletech99)
 
 
Post #: 15
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 5:15:01 AM   
  ebgreen


Posts: 4971
Score: 31
Joined: 7/12/2005
Status: offline
So if I understand correct ly, your plan is to allow a user to run the script like this if they want:

CScript.exe MyScript.vbs /NologoSwitch

In which case it will globally switch the logo off for all their other scripts. If I have this right I don't understand how it is better that telling the user to run this:

CScript.exe //nologo //s  MyScript.vbs

Or even better yet:

CScript.exe //nologo  MyScript.vbs

So that it does not make the change global. I want the people that I support to see the logo so that they can easily tell me what major version of the WSH they are running. As I said I would be very unhappy with any script that globally turned off the logo.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to humbletech99)
 
 
Post #: 16
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 5:16:34 AM   
  humbletech99

 

Posts: 53
Score: 0
Joined: 6/9/2007
Status: offline
yes exactly, 1 line of output only is taken by the executable. This is the reason the logo really messes things up. But in any event, it would just get in the way of whatever you are doing to not have full control of the output of a program you were writing...

EBgreen: ok you made your point, no logo disabler...

< Message edited by humbletech99 -- 1/14/2008 5:17:57 AM >


_____________________________

value(geeks) > value(mundanes)

(in reply to Rischip)
 
 
Post #: 17
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 6:55:44 AM   
  Rischip


Posts: 502
Score: 2
Joined: 3/26/2007
Status: offline
I think the only other option would be to compile the script into an executable.

You can try iexpress which is built into Windows (at least it is in my XP). Just type iexpress at the command line.
This creates a self extracting executable which will contain your vbscript. It will automatically extract it and run it. You can specify the command line to start the script with the //NoLogo command line argument.
It should work for all of the purposes that you are requesting.
The other option is a paid for item called exescript. I'm sure there are others, but I can't think of any at the moment.

< Message edited by Rischip -- 1/14/2008 7:36:23 AM >


_____________________________

Rischip
Author of - The Grim Linker

(in reply to humbletech99)
 
 
Post #: 18
 
 RE: VBScript - Control //NOLOGO from within script? - 1/14/2008 9:34:40 AM   
  TNO


Posts: 1247
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
I still think the html application idea would be easier.

< Message edited by TNO -- 1/14/2008 9:36:20 AM >


_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to Rischip)
 
 
Post #: 19
 
 RE: VBScript - Control //NOLOGO from within script? - 1/15/2008 12:35:22 AM   
  humbletech99

 

Posts: 53
Score: 0
Joined: 6/9/2007
Status: offline
Thank you all very much for your very good ideas.

Rischip, I really like your idea for iexpress, I didn't even know that was there and have never used it before. It seems cool, not quite appropriate for my purpose because the program would be extracted over and over every few minutes on many servers... but I like this idea so I'm keeping this in my back pocket for a different future occasion.

TNO, you are right that an hta might be useful, but this must be a command line program and there is no way I could have anything graphical because it will be called by another program which has no concept of a gui and needs to run the program and just capture the standard output.

I might leave this one for now since there doesn't seem to be any complete solution without some third party software which I tend to avoid if I can.

< Message edited by humbletech99 -- 1/15/2008 12:47:26 AM >


_____________________________

value(geeks) > value(mundanes)

(in reply to TNO)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

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 >> VBScript - Control //NOLOGO from within script? Page: [1] 2   next >   >>
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