Solved

SCRIPTS CAN I HAVE 2 OF THEM

Posted on 2004-10-07
10
233 Views
Last Modified: 2010-03-18
Hello everyone.

I have a default script that is saved in a .bat file which assigns our typical network folders upon login.

I also have a script that is saved in a vbs format for assigned our printers upon login.

In the Active Directory/Users/  and choose a user and their profile/logon script   Can I place both of these in that line somehow

example

login.bat;printers.vbs

Any help is more than appreciated.
0
Comment
Question by:ghjs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
10 Comments
 
LVL 85

Expert Comment

by:oBdA
ID: 12251004
That won't work; the only way to do that is to call one script from the other.
Add the following line to your logon bat:
start "Logon" /wait printers.vbs
should work.
Or you can switch completely to one scritp language. If you want to keep your batch script, you can use con2prt.exe (still runs fine on XP) to map network printers easily in a batch script. If necessary, you can use ifmember.exe to map according to group membership.
Example:

====8<----[logon.cmd]----
@echo off
:: *** Delete all mapped printers:
con2prt.exe /f
:: *** Map the printers according to group membership:
ifmember.exe YourDomain\Printer01Group
if not errorlevel 1 goto EndPrinter01Group
con2prt.exe /c \\PrintServer\Printer01
:EndPrinter01Group

ifmember.exe YourDomain\Printer02Group
if not errorlevel 1 goto EndPrinter02Group
con2prt.exe /c \\PrintServer\Printer02
:EndPrinter02Group
====8<----[logon.cmd]----

How to Use Con2prt.exe to Connect to a Network Printer
http://support.microsoft.com/?kbid=181663

Zero Administration Kit
http://www.microsoft.com/ntworkstation/downloads/Recommended/Featured/NTZAK.asp

Resource Kits Free Tool Downloads: Ifmember.exe
http://www.microsoft.com/windows2000/techinfo/reskit/tools/new/ifmember-o.asp
0
 

Author Comment

by:ghjs
ID: 12251661
I would like to use the simple script if possible with the wait cmd....tried it ...the login works but not the printers..any help..Thanx so much
0
 

Author Comment

by:ghjs
ID: 12251677
do i need quotes around printers.vbs ?
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 
LVL 85

Expert Comment

by:oBdA
ID: 12251795
Not if the script is really called printers.vbs.
You might have to add the path, though (the following assumes that printers.vbs is in the netlogon share):
start "Logon" /wait "%Logonserver%\netlogon\printers.vbs"
0
 
LVL 71

Accepted Solution

by:
Chris Dent earned 200 total points
ID: 12251841

There is an alternative, Kixtart can do all those things you have listed in one script (rather than splitting them). Kixtart ships with the Server Resource kits, or you can download the latest version directly from:

 http://www.kixtart.org/

Then to use it, simply copy the kix32.exe file onto the NETLOGON share, and add the following commands to each file (again in the NETLOGON Share):

Logon.bat would contain:

kix32.exe logon.kix

Logon.kix would contain:

use g: \\server\share
use i: \\server2\share

If InGroup("Printer Group 1")
    AddPrinterConnection("\\server\printer1")
EndIf

Use is the equivelent of the Net Use comamnd in DOS.

Simply add logon.bat to the User Account properties and it should work. Personally I think Kix is a lot easier to use (and generally easily as flexible) than VB Script in these instances.
0
 

Author Comment

by:ghjs
ID: 12252001
UGG I would have loved the simple line script to work but its not...I will look into Kixtart and get back with you asap..Thanks for spending time with me.  Take care!!
0
 
LVL 85

Assisted Solution

by:oBdA
oBdA earned 200 total points
ID: 12252047
Assuming that .vbs is associated with wscript (check in the command line with "ftype vbsfile"), the following should work:
%Systemroot%\System32\WScript.exe "%Logonserver%\netlogon\printers.vbs"
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

FIPS stands for the Federal Information Processing Standardisation and FIPS 140-2 is a collection of standards that are generically associated with hardware and software cryptography. In most cases, people can refer to this as the method of encrypti…
I'm a big fan of Windows' offline folder caching and have used it on my laptops for over a decade.  One thing I don't like about it, however, is how difficult Microsoft has made it for the cache to be moved out of the Windows folder.  Here's how to …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question