Page 1 of 2 12>
Topic Options
#29697 - 2002-09-26 03:26 PM INGROUP command will not function
surfkat Offline
Fresh Scripter

Registered: 2002-09-26
Posts: 19
Loc: Oxford, UK
Hello Folks

I have botched and hacked a script together so I can mount drives on clients machines. The OS are varied, Win95/98 and Win 2000. I have a mixed Domain with ADS running on a few Window 2000 servers with some NT servers.

The script works fine except INGROUP is ingnored on the Windows 2000 client. What am I doing wrong.
Also, can I get rid of the

SHELL "Winset.exe HOMEDIR=@HOMEDIR"???

from the top of the script. I believe its just for the WIn95/98 clients. Using Kix2001 v4.11.00

The rest of the script is here:

I have batch script first:

@ECHO OFF
Z:\kix32.exe /d script1.scr
EXIT

Then this is the script1.scr:

SHELL "winset.exe USERNAME=@USERID"
SHELL "Winset.exe HOMEDIR=@HOMEDIR"
BREAK ON ;(re)set Ctrl-C/Break handling
SMALL
?
"HI, @FULLNAME"
? ""@USERID
?
? "Your Logon Server:" @LSERVER
?
? "Your Password is " @PWAGE " Days Old."
?
? "Home Directory Location:"
? @Homeshr "\" @HomeDir
?
?
CLS
RUN "NET Use F: \\adv***al\apps"
RUN "NET Use H: \\adv**ta\apps"
SLEEP 5
RUN "NET USE U: \\advglobal\@USERID$"
SLEEP 10
If INGROUP("Domain Admins") RUN "Net Use O: \\advmeta\o"
ENDIF
If INGROUP("Sun") RUN "Net Use S: \\advsun\sun426"
ENDIF
SLEEP 4
CLS
RUN "\\adv***bal\interchk\w95inst\setup.exe -inl -a"
RUN "start /wait \\adv***bal\interchk\savagent.exe -update -poll 3600"
RUN "\\adv***bal\interchk\run95sag.exe -update"
sleep 4
EXIT

If you can help. Much appreciated

[Razz]

Cheers

SurfKat

Top
#29698 - 2002-09-26 03:34 PM Re: INGROUP command will not function
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I'm making it short:

@ECHO OFF
Z:\kix32.exe /d script1.scr
EXIT

prevents the script from running on w2k machine.
only win9x has z: mapped to netlogon.

thus you should use:

@ECHO OFF
%0\..\kix32.exe script1.scr
EXIT
_________________________
!

download KiXnet

Top
#29699 - 2002-09-26 03:50 PM Re: INGROUP command will not function
surfkat Offline
Fresh Scripter

Registered: 2002-09-26
Posts: 19
Loc: Oxford, UK
Thanks that worked! Cool.

Now I have another problem. I keep getting device in operation errors and some Winset errors both occur on Windows 2000 client. Any ideas?

Cheers

Thats made my day that as!

Top
#29700 - 2002-09-26 03:53 PM Re: INGROUP command will not function
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
You might also want to take a look at the KiXtart Manual which gevies examples of properly formatted login.bat files or check the Kixtart Starter's Guide or search the KiXtart BBS for 'login.bat'

Also, WINSET is required for Windows 9x unless you're using KiXtart 4.12 beta 1 and later which has improved support for the SETx commands under Windows 9x.

Please replace the sHELL commands with USE and read Not quite everything you wanted to know about RUN and SHELL

Use
code:
?''+@ERROR+' - '+@SERROR

after Kixtart commands/functions to track down which commands are successful and put a DEBUG ON into the first line of your script to step through it.

[ 26. September 2002, 15:55: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#29701 - 2002-09-26 03:58 PM Re: INGROUP command will not function
surfkat Offline
Fresh Scripter

Registered: 2002-09-26
Posts: 19
Loc: Oxford, UK
A big thumbs up to everyone!
Top
#29702 - 2002-09-26 03:59 PM Re: INGROUP command will not function
surfkat Offline
Fresh Scripter

Registered: 2002-09-26
Posts: 19
Loc: Oxford, UK
A big thumbs up to everyone!

I have put

RUN "NET USE "*" /DELETE"

before all the other mount lines.

This get rid of the device in use operation error. Now what do I have to do with WINSET, do I need it for Windows95/98 machine to read the commands?

Cheers

Top
#29703 - 2002-09-26 04:03 PM Re: INGROUP command will not function
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
don't use run 'net use...'
use shell... run will go in it's own process and the script might bump into each other.

use shell or just 'use * /delete /persistent'
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#29704 - 2002-09-26 04:04 PM Re: INGROUP command will not function
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Yes, do DO need WINSET for Windows 9x (and only Windows 9x) unless you are using KiXtart 4.12 beta 1. Use
code:
if @inwin=2
; winset stuff
endif

to execute it under Windows 9x only.
_________________________
There are two types of vessels, submarines and targets.

Top
#29705 - 2002-09-26 04:05 PM Re: INGROUP command will not function
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
actually:
RUN "NET USE "*" /DELETE"

is wrong.
it will only do:
RUN "NET USE "

it should be:
RUN 'NET USE "*" /DELETE'

to make it kixtart (faster kixtarts own command) replace that line with:
USE "*" /DELETE /persistent

the persistent switch removes those errors for good.
_________________________
!

download KiXnet

Top
#29706 - 2002-09-26 04:07 PM Re: INGROUP command will not function
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Actually, DO NOT use RUN/SHELL at all for mapping drives. Please use the build-in KiXtart USE command.
_________________________
There are two types of vessels, submarines and targets.

Top
#29707 - 2002-09-26 04:14 PM Re: INGROUP command will not function
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
actually...
this thread is getting nice [Wink]
 
_________________________
!

download KiXnet

Top
#29708 - 2002-09-26 04:25 PM Re: INGROUP command will not function
surfkat Offline
Fresh Scripter

Registered: 2002-09-26
Posts: 19
Loc: Oxford, UK
It is getting nice.

It quite warming to know our small planet can work together!

I am just altering the script and checking it.

Thank again.

Should be back in a few moments to tell you how it worked out.

Top
#29709 - 2002-09-26 04:41 PM Re: INGROUP command will not function
surfkat Offline
Fresh Scripter

Registered: 2002-09-26
Posts: 19
Loc: Oxford, UK
[Big Grin] [Big Grin] [Big Grin] [Big Grin] [Big Grin] [Big Grin]

Thanks guys it works!!!!

Here is the full script, you are wrote.

?''+@ERROR+' - '+@SERROR
if @inwin=2 ; winset stuff
SHELL "winset.exe USERNAME=@USERID"
SHELL "Winset.exe HOMEDIR=@HOMEDIR"
endif
BREAK ON ;(re)set Ctrl-C/Break handling
SMALL
?
"HI, @FULLNAME"
? ""@USERID
?
? "Your Logon Server:" @LSERVER
?
? "Your Password is " @PWAGE " Days Old."
?
? "Home Directory Location:"
? @Homeshr "\" @HomeDir
?
?
CLS
USE "*" /DELETE
Use F: \\adv**bal\apps
Use H: \\adv**ta\apps
SLEEP 5
USE U: \\adv**bal\@USERID$
SLEEP 10
If INGROUP("Domain Admins") Use O: \\adv**ta\o ENDIF
If INGROUP("Sun") Use S: \\ad**un\sun426
ENDIF
SLEEP 4
CLS
EXIT

Not quite sure if I have the correct location for

?''+@ERROR+' - '+@SERROR

Cheers

Top
#29710 - 2002-09-26 04:43 PM Re: INGROUP command will not function
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Get rid of the SLEEPs.
_________________________
There are two types of vessels, submarines and targets.

Top
#29711 - 2002-09-26 04:52 PM Re: INGROUP command will not function
surfkat Offline
Fresh Scripter

Registered: 2002-09-26
Posts: 19
Loc: Oxford, UK
Guys

I have a problem! The User drive mapping is not working on either Win98 or Win2K. Any ideas?

Have changed line to:

USE U: \\advglobal\@USERID$$

It worked when I had the line as

RUN "NET USE.... etc

What do you think?

Cheers

Top
#29712 - 2002-09-26 04:57 PM Re: INGROUP command will not function
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
You probably don't need the "winset' commands. Do you have an applications or utilities that use this these environment variables? If this info is only referenced during logon, you can probably restructure your scripts so you don't need to do this.
_________________________
Jack

Top
#29713 - 2002-09-26 04:58 PM Re: INGROUP command will not function
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
what about:

USE U: "\\advglobal\@USERID$$"
_________________________
!

download KiXnet

Top
#29714 - 2002-09-26 04:59 PM Re: INGROUP command will not function
surfkat Offline
Fresh Scripter

Registered: 2002-09-26
Posts: 19
Loc: Oxford, UK
I can confirm

RUN "NET USE U: \\advglobal\@USERID$"

Works.

I have looked at the other bbs messages, and it does seem confusing!

Can anyone suggest a good book covering scripting on Windows machines?

Cheers

Rob

Top
#29715 - 2002-09-26 05:07 PM Re: INGROUP command will not function
surfkat Offline
Fresh Scripter

Registered: 2002-09-26
Posts: 19
Loc: Oxford, UK
[Big Grin] [Big Grin] [Big Grin] [Big Grin]

USE U: "\\advglobal\@USERID$"

Yes this works.

Thanks for all your help.

Have a great weekend

cheers

Rob [Cool]

Top
#29716 - 2002-09-26 05:32 PM Re: INGROUP command will not function
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Better syntax would be
code:
USE U: '\\advglobal\'+@USERID+'$'

I prefer not to have KiXtart variables/macros within a quote-delimited string.

[ 26. September 2002, 18:14: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
Page 1 of 2 12>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 781 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.066 seconds in which 0.026 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org