.NETGURU
Replace bat-file with a script!
Messages   Related Types
This message was discovered on microsoft.public.dotnet.languages.jscript.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Christian-Josef Schrattenthaler
Hi!

I have a batch-file (*.bat) which logon the client to our server, including
printer and drive mappings.

Now I want to replace the batch-file with a script for the windows scripting
host, because I want the users to enter their username and password, and
then the script should make the mappings suitable to the username...

I lookd for the WSH and VBSCRIPT and JSCRIPT, but I didn't get any usable
information!

Is it possible, to write such a script? Or does the WSH not support this
feature?

Thanks and greetings,
Christian.

Reply to this message...
 
    
McKirahan
"Christian-Josef Schrattenthaler" <Click here to reveal e-mail address> wrote in message
news:ufvK$Click here to reveal e-mail address...
[Original message clipped]

A Google search of "WSH Logon script" returned:

WSH Logon Scripts
http://www.winnetmag.com/Articles/Index.cfm?ArticleID=4760&pg=1

Reply to this message...
 
    
Torgeir Bakken \(MVP\) (VIP)
Christian-Josef Schrattenthaler wrote:

[Original message clipped]


In VBScript, you can use InputBox to ask for username and password,
and MapNetworkDrive to map a network drive supplying username and
password if needed.

Note that you can pick up the current user name like this:

Set objWshNet = CreateObject("WScript.Network")
strCurrentLoggedInUser = objWshNet.UserName
WScript.Echo strCurrentLoggedInUser

You can also from your vbscript use the Internet Explorer object
to ask for and mask password input, take a look here:

http://groups.google.com/groups?selm=3EB7E661.7D857459%40hydro.com

The script in the link above requires IE 5.5+, if you want the script
to work on IE 5.01 as well, remove the following two lines (this will
re-enable right-click menu on the dialog):

& " onContextmenu='window.event.cancelbubble=true" _
& ":window.event.returnvalue=false'" _

If you have Win98 or WinME computers, this might be relevant for the
PasswordBox routine in the link above:

http://groups.google.com/groups?threadm=e3496be5.0309162049.6c28474e%40posting.google.com

WSH 5.6 documentation (local help file) can be downloaded from here
if you haven't got it already:
http://msdn.microsoft.com/downloads/list/webdev.asp

--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Reply to this message...
 
    
Christian-Josef Schrattenthaler
"Torgeir Bakken (MVP)" <Click here to reveal e-mail address> schrieb im
Newsbeitrag news:Click here to reveal e-mail address...

[Original message clipped]

I know InputBox, but I can only ask for one. It is not possible to create a
windows which asks for the username and the password. Or do you have a hint,
how this works?

Greetings,
Christian.

Reply to this message...
 
    
Torgeir Bakken \(MVP\) (VIP)
Christian-Josef Schrattenthaler wrote:

[Original message clipped]


Did you take a look at the other link I gave you? You can use the
Internet Explorer object to do this (as the script in the link in
my other post in this thread do).

--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx
Reply to this message...
 
    
Welman Jordan
"Torgeir Bakken (MVP)" <Click here to reveal e-mail address> wrote in message
news:%23szP2B$Click here to reveal e-mail address...
[Original message clipped]

And another approach is to use HTML application (HTA).

Reply to this message...
 
    
Jared
Pardon me, but, am I missing something? Your users have just authenticated
to your domain, and now, you want them to supply their credentials all over
again just to map their drives and printers? In my opinion this should be
transparent to the end user. You can use WSH to get the username of the
currently logged on user, use that to map as desired. I would hate to work
in your company, logging in twice???

"Welman Jordan" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
 




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification