#66708 - 2002-06-11 09:29 PM
%USERNAME% on 95/98
|
alex13507
Fresh Scripter
Registered: 2002-04-26
Posts: 12
|
I'm quite new to the whole kixtart thing... but am quite impressed.. as it makes 95/98 boxes useable... here's my question:
if not exist("C:\Program Files\Microsoft Office\Office\MSACCESS.EXE") copy "c:\sometextfile.txt" "\\server\share\%USERNAME%.txt" endif
very simple.. but the %USERNAME% doesn't work on 95/98... can i use something else? any ideas?
|
|
Top
|
|
|
|
#66710 - 2002-06-11 09:41 PM
Re: %USERNAME% on 95/98
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
Kix is great, but nothing makes wintendo useable...
except terminal services (sometimes...) [ 11 June 2002, 21:42: Message edited by: Radimus ]
|
|
Top
|
|
|
|
#66713 - 2002-06-11 11:15 PM
Re: %USERNAME% on 95/98
|
kholm
Korg Regular
   
Registered: 2000-06-19
Posts: 714
Loc: Randers, Denmark
|
Radimus,
You must have had a traumatic experience once witch included a Win9x workstation
-Erik
|
|
Top
|
|
|
|
#66715 - 2002-06-16 04:08 AM
Re: %USERNAME% on 95/98
|
MCA
KiX Supporter
   
Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
|
Dear,
Another way of catching "userid" can be done with following code Specially for windows 9x usefull.
code:
$user="" IF (@inwin = 1) $ikey="HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon" IF (ExistKey($ikey) = 0) $user=ReadValue($ikey, "DefaultUserName") ENDIF ELSE $ikey="HKEY_LOCAL_MACHINE\System\CurrentControlSet\control" IF (ExistKey($ikey) = 0) $user=ReadValue($ikey, "Current User") ENDIF ENDIF IF (len($user) = 0) $user=@userid IF (len($user) = 0) $user="~user" ENDIF ENDIF ? "user: "+$user
in some situations (depending of windows version running) you doesn't get the right value with "@userid" macro call. In our script logon.kix you can find also information about the way of getting other macro value by only reading related registry keys. You find it on our site http://home.wanadoo.nl/scripting greetings.
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 507 anonymous users online.
|
|
|