Page 1 of 1 1
Topic Options
#194603 - 2009-07-07 03:26 PM Works on XP but not Vista
ares4life Offline
Fresh Scripter

Registered: 2009-06-06
Posts: 6
Loc: VT
Hello All,

I have a script that works fine on XP, but on vista, for some reason it cannot find the proper group memberships. Any idea's?


 Code:
;  KIXTART.SCR
;
;  KiXtart sample default logon script
;
;  Note :  This code sample is provided for demonstration purposesonly.
;          Microsoft makes no warranty, either express or implied,
;          as to its usability in any given situation.
;
;   Copyright (C) 2001 Ruud van Velsen.
;   All rights reserved.
;
CLS

small
Color b+/n
BOX (0,0,24,79,GRID)            ; 'background grid'
Color b/n
BOX (8,21,18,61,Å)              ; 'shadow' of the box'
Color g+/n
BOX (3,20,20,65,FULL)

Color w+/n
select 
  case val(left(@time,2))<12
    at (5,22) "Good Morning " + @fullname + ","
  case val(left(@time,2))<18
    at (5,22) "Good Afternoon " + @fullname + ","
  case 1
    at (5,22) "Good Evening " + @fullname + ","
endselect

at (7,22) "Please Wait For Logon script Execution"
AT ( 9,25) "Userid       : "    ; display some text strings
AT (10,25) "Full name    : "
AT (11,25) "Privilege    : "
AT (12,25) "Workstation  : "
AT (13,25) "Domain       : "
AT (14,25) "Logon Server : "

Color y+/n
AT ( 9,40) @userid              ; ...and some macro's
AT (10,40) @fullname
AT (11,40) @priv
AT (12,40) @wksta
AT (13,40) @domain
AT (14,40) @lserver

Color w/n
; $userdir=@userid + "$$" ;
settime "\\PDC"

; Mount general shares for staff
;

use Z: "\\bdc\staffshares" /PERSISTENT:NO
use H: "\\bdc\" + @userid /PERSISTENT:NO


IF INGROUP("Domain Users")  
  If AddPrinterConnection("\\print\hp4100n") = 0
    ? AT (16,25) "Added printer connection to printer."
    $rc=SetAsDefaultPrinter("\\print\hp4100n")
  EndIf
ENDIF



; If within the Domain Admins Group
; Set the AdminFiles share

IF INGROUP("Domain Admins") 
  use X: "\\bdc\adminfiles" /PERSISTENT:NO
ENDIF

sleep 4 ;
AT (18,25) "Logon complete. Closing application"
sleep 10 ;
exit


function SetAsDefaultPrinter($printer)
  $SetAsDefaultPrinter=1
  if setdefaultprinter($printer)=0
    $SetAsDefaultPrinter=0
  else
    dim $PrintServer,$PrintQueue[0],$sharedprinter,$rc,$server
    $PrintQueue[0]="PrintQueue"
    if instr($printer,"\\") 
      $server=split($printer,"\")[2]
      $printer=split($printer,"\")[3]
    else
      $server=@wksta
    endif
    $PrintServer=GetObject("WinNT://" + $server + ",computer")
    if @error
      exit @error
    else
    $Printserver.filter=$PrintQueue   
    for each $sharedprinter in $printserver
      if $sharedprinter.name=$printer
        $rc=setdefaultprinter($sharedprinter.printername)
        if $rc=0
          $SetAsDefaultPrinter=0
          exit 0
        else
          $SetAsDefaultPrinter=$rc
          exit @error
        endif
      endif
    next
  endif 
endfunction

Top
#194605 - 2009-07-07 03:36 PM Re: Works on XP but not Vista [Re: ares4life]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
What version of Kix are you using? I bet it is 4.60. 4.60 has some issues and 4.61 is in beta so fixes are coming but are not publicly available for now.

Can you try with 4.53?
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#194608 - 2009-07-07 04:20 PM Re: Works on XP but not Vista [Re: Mart]
ares4life Offline
Fresh Scripter

Registered: 2009-06-06
Posts: 6
Loc: VT
i do not know the version exactly, however the Modification date is 10/2/2007.
Top
#194609 - 2009-07-07 04:39 PM Re: Works on XP but not Vista [Re: ares4life]
Gargoyle Offline
MM club member
*****

Registered: 2004-03-09
Posts: 1597
Loc: Valley of the Sun (Arizona, US...
At your command line C:\Scripts\> type in "KIX32 /?"

What is failing?
_________________________
Today is the tomorrow you worried about yesterday.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 259 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.05 seconds in which 0.022 seconds were spent on a total of 13 queries. Zlib compression enabled.

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