IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New 98 login script
We have a label system that must run on 98. Newer versions of Windows have "total control" over the printer and conflict with the label software, resulting in lots of wasted labels.

One of the problems we're having is sometimes the user types their password wrong, but 98 still lets them in. When that happens, the drive mappings fail and prompts come up "do you want to keep this mapping for next time?". The user's been clicking no, which means we keep having to remap the drives.

I figured a login script might solve the problem and have been googling to figure out how to write one. I've got this much figured out so far:

net use /persistent:no
net use */delete /y
net use k: \\server\\apps
net use o: \\server\\labels


I've not found anything on "error recover" for failure of NET USE to map a drive. What I'd like to have happen is to log off the user if the drive letters don't map.

Any suggestions on where to look or how to do it? Thanx!

Note: just noticed the preview's showing a single \\ in front of server even though I typed two of them.
1 slash - \\
2 slashes - \\
3 slashes - \\\\
4 slashes - \\\\
Darrell Spice, Jr.                      [link|http://www.spiceware.org/cgi-bin/spa.pl?album=./Artistic%20Overpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore
New Don't have a 98 machine here at work, so from top of head...
After the NET USE try adding a
IF EXIST K:Null NextDrive
Reboot
:NextDrive
Net Use...

Little drastic, but might work.
[link|mailto:jbrabeck@attbi.com|Joe]
New Re: 98 login script
We have a label system that must run on 98. Newer versions of Windows have "total control" over the printer and conflict with the label software, resulting in lots of wasted labels.

You can change the printing to RAW, unspooled. I'm sure it can print via Windows. We have an old dedicated barcode printer that works fine from Windows, after some adjustments.

Share the printer hidden but with universal permissions - put a $ on the end of the share name. Set permissions to Everyone. On the "Details" tab of the printer properties page, change the spooling format to "Print directly to printer", "RAW".
-drl

(Dm - 2Am)(Rmn + 1/2gmn R + 1/2Fmn) = 0
Expand Edited by deSitter April 17, 2003, 04:49:21 PM EDT
New thanx
I'll have to give that a try.
Darrell Spice, Jr.                      [link|http://www.spiceware.org/cgi-bin/spa.pl?album=./Artistic%20Overpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore
New little closer
@echo off

rem clear any existing drive mappings
net use * /delete /y

rem map label drives
net use K: \\\\server\\apps
net use O: \\\\server\\labels

rem set time
net time \\\\server /set /yes

if not exist K: goto LogOff
rem echo "K: exists"
if not exist O: goto LogOff
rem echo "O: exists"
rem echo "Drives Mapped OK"
exit

:Logoff
rem echo "log off user"
rundll32.exe shell32.dll,SHExitWindowsEx 4


logoff works OK(the rundll line), but the NET USE command prompts the user for input if the ID/password was wrong:
The password is invalid for \\\\SERVER\\APPS. For more information, contact your network administrator.
Type the password for \\RTRON_PDC1\\APPS:


Having the user reenter their password would be fine except that the problem is they'll often forget to change the user ID, so the password would never be correct. Anybody know if there's a way to make NET USE just fail instead of prompt?
Darrell Spice, Jr.                      [link|http://www.spiceware.org/cgi-bin/spa.pl?album=./Artistic%20Overpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore
New "net use K: \\\\server\\apps > NUL" ?
New solution
the NUL was a good idea, but didn't work(I tried both > and <). I discovered that NET TIME would fail if id/password were incorrect, so I'm using that for validation:

@echo off
rem this script confirms the user entered valid id/password
rem if invalid, it restarts windows
rem else it maps the required network drives

rem set time, if it fails then userid/password is invalid
net time \\\\server /set /yes
if errorlevel 1 goto LogOff

rem clear any existing drive mappings
net use * /delete /y

rem map label drives
net use K: \\\\server\\apps /yes
net use O: \\\\server\\labels /yes

rem test that drives mapped OK
if not exist K: goto LogOff
if not exist O: goto LogOff
exit

:Logoff
echo "Password was wrong, restarting Windows"
rundll32.exe shell32.dll,SHExitWindowsEx 6


I also had to change the last parameter in the rundll32 line from 4 to 6. 4 does a logoff while 6 does a reboot. Logoff seems like it would make more sense, but it wasn't doing a true logoff. The logon prompt would show up, but the rest of the desktop remained and the user could cancel it w/out the script running again.

I'm off to San Antonio(had a busy half day) so I'll see y'all next week.
Darrell Spice, Jr.                      [link|http://www.spiceware.org/cgi-bin/spa.pl?album=./Artistic%20Overpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore
New One question...
Where are you executing this script? I may want to try something like this also.
[link|mailto:jbrabeck@attbi.com|Joe]
New startup folder
start->programs->startup
Darrell Spice, Jr.                      [link|http://www.spiceware.org/cgi-bin/spa.pl?album=./Artistic%20Overpass|Artistic Overpass]\n[link|http://www.spiceware.org/|SpiceWare] - We don't do Windows, it's too much of a chore
New Thanks
[link|mailto:jbrabeck@attbi.com|Joe]
     98 login script - (SpiceWare) - (9)
         Don't have a 98 machine here at work, so from top of head... - (jbrabeck)
         Re: 98 login script - (deSitter) - (1)
             thanx - (SpiceWare)
         little closer - (SpiceWare) - (1)
             "net use K: \\\\server\\apps > NUL" ? -NT - (CRConrad)
         solution - (SpiceWare) - (3)
             One question... - (jbrabeck) - (2)
                 startup folder - (SpiceWare) - (1)
                     Thanks -NT - (jbrabeck)

On bassline: Martina Nav... Navri... gosh, I wish she'd get married.
101 ms