Page 1 of 1 1
Topic Options
#66708 - 2002-06-11 09:29 PM %USERNAME% on 95/98
alex13507 Offline
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
#66709 - 2002-06-11 09:36 PM Re: %USERNAME% on 95/98
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Check the manual for the Kixtart macros, then you'll find @USERID. So, the modified code would be
code:
if not exist('C:\Program Files\Microsoft Office\Office\MSACCESS.EXE')
copy 'c:\sometextfile.txt' '\\server\share\'+@USERID+'.txt'
endif

You might also want to look up ExpandEnvironmentVars() in the manual. It comes in handy sometimes.

[ 11 June 2002, 21:36: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#66710 - 2002-06-11 09:41 PM Re: %USERNAME% on 95/98
Radimus Moderator Offline
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 ]
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#66711 - 2002-06-11 09:43 PM Re: %USERNAME% on 95/98
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
What about FDISK ?
_________________________
There are two types of vessels, submarines and targets.

Top
#66712 - 2002-06-11 09:50 PM Re: %USERNAME% on 95/98
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
Ok..

Here is one to do this from the command line. [Smile]

1786 » Another way to set %UserName%, %ComputerName%, and %LogonServer% for W9x.

If you want to play with some of the Kixtart environment variables - 0120 » Solve those logon script problems.

Have a nice day!

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#66713 - 2002-06-11 11:15 PM Re: %USERNAME% on 95/98
kholm Offline
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 [Wink]

-Erik

Top
#66714 - 2002-06-11 11:34 PM Re: %USERNAME% on 95/98
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
radimus, you can surely use wintendo machine if the bios and nic-card are bootb compliant.
this way you can use them for terminal emulation or even terminal x-emulation!
_________________________
!

download KiXnet

Top
#66715 - 2002-06-16 04:08 AM Re: %USERNAME% on 95/98
MCA Offline
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.
_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
Page 1 of 1 1


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

Who's Online
0 registered and 507 anonymous users online.
Newest Members
Sir_Barrington, batdk82, StuTheCoder, M_Moore, BeeEm
17886 Registered Users

Generated in 0.059 seconds in which 0.025 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