Christian-Josef Schrattenthaler wrote:
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.
WSH has no mechanism for input, but that shouldn't be necessary. Simply make
your WSH script run _after_ the user logs into the workstation. They will
authenticate against whatever authentication mechanism you are using and then
the script can connect to the network resources.
To set up network drives and printers in WSH it would be something like:
-- logon.js --
var wshNetwork = new ActiveXObject("WScript.Network");
wshNetwork.MapNetworkDrive("Z:", "\\\\Server\\path\\to\\share");
wshNetwork.AddWindowsPrinterConnection("\\\\Server \\path\\to\\printer");
To test it, just use Start -> Run -> type "c:\path\to\logon.js" and hit Enter
(or run it from cmd or whatever)
All sorts of information about the WshNetwork object at <url:
http://www.devguru.com/Technologies/...shnetwork.html />
--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq