473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Replace batch-file with script?

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.
Jul 23 '05 #1
1 2020
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
Jul 23 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Richard Wesley | last post by:
I am busy converting a single Zope page to a Python cgi using the standalone ZPT implementation from sourceforge. Most of it seems to work just fine, but I am finding that although the Batch...
3
by: Zack Sessions | last post by:
I have a table that has a Text datatype column that has gotten some garbage characters in it somehow, probably from key entry. I need to remove the garbage, multiple occurances of char(15). The...
5
by: Tyler Hudson | last post by:
After reading Erland Sommarskog's most enlightening articles on SQL Server 2000's error handling capabilities (http://www.sommarskog.se/error-handling-I.html and...
2
by: Paul Reddin | last post by:
Hi, (V8.1 Fp2) Our application uses JDBC batch to execute mutiple insert statements and we saw a strange thing this morning. There were 4 SQL Insert statements in the batch, and we know the...
2
by: Blippy | last post by:
I want to create a small look up program that searches for a certain date and the batch number that is represented by that day. For instance if i wanted to find the batch for 20/08/05 i would...
12
by: Selva Chinnasamy | last post by:
Hi I am using batch commands against Ms-Access and getting an error Message "Characters found after end of SQL statement." String Here is my sql Dim str_screens As String = "Select * from Screens...
12
by: tojigneshshah | last post by:
Hi, I have a situation where i have multiple batch and the each batch are sequence numbers. For each batch, the number should start with 1. For example: Col.no1 Col.no2 ------ ...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
1
by: fosforito | last post by:
How can you replace text in batch mode (that is, a large text with many entries of that kind)? For example: Look for "http://microsoft.com/serverads/" and replace it for...
11
by: bcurtu | last post by:
Hi, I have a BIIIIIG problem with the next query: cursor.execute(""" SELECT titem.object_id, titem.tag_id FROM tagging_taggeditem titem WHERE titem.object_id IN (%s) """,( eid_list))
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.