WSH/VBS in not easy for me. 
Author Message
 WSH/VBS in not easy for me.

Hi All,

I need very basic help. I know this is going to be easy for YOU. It is for
my testing purposes.

I have in my LAB only one SERVER (W2K, AD, native mode, DOMAIN.com) and two
workstations W98 and W2000. User1 logs on to W98 and User2 logs on to W2000.

Could you please show me simple VBS/WSH (???) logon script for all users and
computers? On Clarence Washington site it is so complicated and I am a
NEWBIE!!!

My logon.bat already calls logon.vbs. In logon.vbs I would like to have:

1. Set net time to SERVER

2. Map H: to \\SERVER\Users\%Username% (so User1 cannot see User2)

3. Connect PRINTER on SERVER for all DOMAIN.com users

Can you please help? These basics would help me tremendously in learning
more!

Thank you very much in advance. I appreciate very much your input.

Regards,

Danielle



Sun, 02 May 2004 21:36:01 GMT  
 WSH/VBS in not easy for me.
To map a drive

Set WshNetwork = CreateObject("WScript.Network")
on error resume next
WshNetwork.MapNetworkDrive "Z:", "\\computer\share"
*************
To set a printer

Set WshNetwork = CreateObject("WScript.Network")
PrinterPath = "\\printserver\printershare"
PrinterDriver = "HP LaserJet 4050 Series PS"
WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
WshNetwork.SetDefaultPrinter "\\printserver\printershare"
****************
On your Windows 2000 server Cd Find this file wsh.chm It has all the basics
in it to help you along.
--
Regards,

Mike Holzemer
No email replies please - reply in newsgroup

Quote:
> Hi All,

> I need very basic help. I know this is going to be easy for YOU. It is for
> my testing purposes.

> I have in my LAB only one SERVER (W2K, AD, native mode, DOMAIN.com) and
two
> workstations W98 and W2000. User1 logs on to W98 and User2 logs on to
W2000.

> Could you please show me simple VBS/WSH (???) logon script for all users
and
> computers? On Clarence Washington site it is so complicated and I am a
> NEWBIE!!!

> My logon.bat already calls logon.vbs. In logon.vbs I would like to have:

> 1. Set net time to SERVER

> 2. Map H: to \\SERVER\Users\%Username% (so User1 cannot see User2)

> 3. Connect PRINTER on SERVER for all DOMAIN.com users

> Can you please help? These basics would help me tremendously in learning
> more!

> Thank you very much in advance. I appreciate very much your input.

> Regards,

> Danielle



Mon, 03 May 2004 01:22:55 GMT  
 WSH/VBS in not easy for me.
Thank you Mike.
My logon.vbs already maps some network drives properly. I am still unable to
map home directory to user name. How can I map "H" Drive for User1 on Win98
and User2 on W2000 to \\SERVER\USERS\%UserName% using logon script with
WSH/VBS? I'd like to have it the way that User sees only own files and
folders under "H" and cannot see other user home directory. Is it possible?
Thanks again,

Danielle


Quote:
> To map a drive

> Set WshNetwork = CreateObject("WScript.Network")
> on error resume next
> WshNetwork.MapNetworkDrive "Z:", "\\computer\share"
> *************
> To set a printer

> Set WshNetwork = CreateObject("WScript.Network")
> PrinterPath = "\\printserver\printershare"
> PrinterDriver = "HP LaserJet 4050 Series PS"
> WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
> WshNetwork.SetDefaultPrinter "\\printserver\printershare"
> ****************
> On your Windows 2000 server Cd Find this file wsh.chm It has all the
basics
> in it to help you along.
> --
> Regards,

> Mike Holzemer
> No email replies please - reply in newsgroup


> > Hi All,

> > I need very basic help. I know this is going to be easy for YOU. It is
for
> > my testing purposes.

> > I have in my LAB only one SERVER (W2K, AD, native mode, DOMAIN.com) and
> two
> > workstations W98 and W2000. User1 logs on to W98 and User2 logs on to
> W2000.

> > Could you please show me simple VBS/WSH (???) logon script for all users
> and
> > computers? On Clarence Washington site it is so complicated and I am a
> > NEWBIE!!!

> > My logon.bat already calls logon.vbs. In logon.vbs I would like to have:

> > 1. Set net time to SERVER

> > 2. Map H: to \\SERVER\Users\%Username% (so User1 cannot see User2)

> > 3. Connect PRINTER on SERVER for all DOMAIN.com users

> > Can you please help? These basics would help me tremendously in learning
> > more!

> > Thank you very much in advance. I appreciate very much your input.

> > Regards,

> > Danielle



Mon, 03 May 2004 04:11:01 GMT  
 WSH/VBS in not easy for me.
Danielle, this is a classic rpoblem with Win9x command shell limits (when
_not_ usingWSH).  It still requires some special setup when using WSH.

the problems are:
(1) Win9x cannot root map a folder.  In other words, if you try to map drive
"H" to \\ myserver \ users \ jsmith, it will actually map H to \\ myserver \
users.

(2) Of course, native Win9x does not recognize a %username% variable - this
exists on NT, but not 9x.

SOLUTIONS
(1) Server side, to make home folders visible to all users and only the
individual users, what I have done in the past is to directly create hidden
shares of each folder, then map to those.  In other words, I share each
user's folder under the sharename %username% and add a $ - jsmith's folder
would be shared as jsmith$.  The $ hides the share
(2) In User manager, I then set the path to the user's home share as
 \\ myserver \ jsmith$
you can actually select a bunch of users at once and set their home
directories by using this form:
\\ myserver \ %username%^$
The drive letter must be set to the same one you will use in the logon
script for their home drive letter
(3) You can still use a batch file for home drive mappings at this point,
using the ?HOME switch. If you have the homes directly shared as above and
the drive letter set to "h", you can use the line:
net use h: /home

Hope that helps


Quote:
> Thank you Mike.
> My logon.vbs already maps some network drives properly. I am still unable
to
> map home directory to user name. How can I map "H" Drive for User1 on
Win98
> and User2 on W2000 to \\SERVER\USERS\%UserName% using logon script with
> WSH/VBS? I'd like to have it the way that User sees only own files and
> folders under "H" and cannot see other user home directory. Is it
possible?
> Thanks again,

> Danielle



> > To map a drive

> > Set WshNetwork = CreateObject("WScript.Network")
> > on error resume next
> > WshNetwork.MapNetworkDrive "Z:", "\\computer\share"
> > *************
> > To set a printer

> > Set WshNetwork = CreateObject("WScript.Network")
> > PrinterPath = "\\printserver\printershare"
> > PrinterDriver = "HP LaserJet 4050 Series PS"
> > WshNetwork.AddWindowsPrinterConnection PrinterPath, PrinterDriver
> > WshNetwork.SetDefaultPrinter "\\printserver\printershare"
> > ****************
> > On your Windows 2000 server Cd Find this file wsh.chm It has all the
> basics
> > in it to help you along.
> > --
> > Regards,

> > Mike Holzemer
> > No email replies please - reply in newsgroup


> > > Hi All,

> > > I need very basic help. I know this is going to be easy for YOU. It is
> for
> > > my testing purposes.

> > > I have in my LAB only one SERVER (W2K, AD, native mode, DOMAIN.com)
and
> > two
> > > workstations W98 and W2000. User1 logs on to W98 and User2 logs on to
> > W2000.

> > > Could you please show me simple VBS/WSH (???) logon script for all
users
> > and
> > > computers? On Clarence Washington site it is so complicated and I am a
> > > NEWBIE!!!

> > > My logon.bat already calls logon.vbs. In logon.vbs I would like to
have:

> > > 1. Set net time to SERVER

> > > 2. Map H: to \\SERVER\Users\%Username% (so User1 cannot see User2)

> > > 3. Connect PRINTER on SERVER for all DOMAIN.com users

> > > Can you please help? These basics would help me tremendously in
learning
> > > more!

> > > Thank you very much in advance. I appreciate very much your input.

> > > Regards,

> > > Danielle



Mon, 03 May 2004 04:34:09 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Execute a Bat Utilizing VBS (not asp or wsh)

2. ByRef not working in WSH/VBS

3. Easy question re: VBS file association

4. Not so easy!

5. Easy question (but not for me)

6. Not that easy

7. Easiest way to find in Word is installed in a computer or not

8. How to pass back variables from called vbs from vbs using wsh

9. NEED an Easy WSH Script written

10. DevStudio through JS/WSH and VBS/WSH

11. .vbs file to play a .wav if file size does not equal 0

 

 
Powered by phpBB® Forum Software