Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript - Control //NOLOGO from within script?

Status
Not open for further replies.

humbletech99

Programmer
Nov 22, 2005
155
0
0
GB
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.
 
Well there is an unpopular but often appropriate saying: read the manual.

You just run your script through a .WSH file. The example in the documentation is:
Code:
[ScriptFile]
Path=C:\WINNT\Samples\WSH\showprop.vbs
[Options]
Timeout=0
DisplayLogo=1
BatchMode=0
Just change DisplayLogo to 0 to suppress the logo.
 
yes but this sucks because then you have to pass around another file with that file all the time, it's as bad as having to wrap it in a batch file.

I did find that in the docs, but it's really not what I want to do.

I need this thing to be self contained.
 
Run administration script from the server to change the file association registry of every m/c. If need of doing anything at all is l*** or s*** or whatever emotional label attaching to it, it really is all that.
 
no I want to give people a script to run from the command line and I cannot do this against their machines I have no access to.
 
If the user doesn't like to see the logo line(s), they use //nologo file association as they like. Some may like to see the logo. Why do you concern it more than they do?
 
because the definition of the progam I am writing must integrate with another program which only allows one line of output and the logo would sploit that, so the only output received would be that of the first line of the logo.

There is no opportunity to change than program.
 
If the script is called from the caller program/script, the nologo can be put there.
 
yes I know, it's just inconvenient. It would be good if the script could switch this off...
 
The logo is produced very early in the running of CScript, making it tough for the script itself to have any influence. The only option I see is to use another script host. Using an alternative script host will naturally involve some script changes.

The few alternatives that come to mind are:

[ul]
[li]A 3rd party script host such as NSBasic/Desktop[/li]
[li]A custom script host written in VB6 using the Script Control[/li]
[/ul]
 
>yes I know, it's just inconvenient.
You seem to know everything except the essence of work and in particular the spirit of scripting.
 
dilettante, that's an interesting idea. I tend to like to stick with standardization and on this occasion, rather than using some non-standard 3rd party script host, (which may make my program less portable), I've decided that I may just add a script //nologo //s inside the script so that the logo will only be shown on the first run and never on any subsequent runs.

The reason is that the script may be distributed to other people and that it will be called often, so I think overall this is a better solution.
 
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.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
I tend to like to stick with standardization and on this occasion, rather than using some non-standard 3rd party script host, (which may make my program less portable), ...
Well I can appreciate that.

NSBasic/Desktop doesn't claim to work except on NT 4.0 and later. However it produces a single EXE with no dependencies except the VBScript engine in Windows and any external component libraries you might use. Because of that a simple "Hello World" results in a 300KB EXE! But the built-in script host does provide forms and controls like those in VB 5 and 6 (even a DoEvents) for interactive applications. Of course it also can make formless command-line EXEs. It lets you call most APIs directly too, without writing a separate VB6 component to mediate. It also offers a very VB-like IDE.

Of course it isn't free.

It's just another idea. I don't have anything to do with the company that makes it.

It's pretty portable though. I just copied an NSB EXE to a Vista machine by itself and it ran just fine.
 
thanks, that's pretty interesting... not really interested in 3rd party proprietary stuff any more these days though...

EBgreen, I may make the //nologo change an option...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top