Page 1 of 1 1
Topic Options
#42752 - 2003-07-11 11:30 AM Output Username to file
zerhyr Offline
Lurker

Registered: 2003-07-10
Posts: 3
Hi

I've created a script to launch Windows media player 9. From this script, it will install and create an output file for the username. My issue is that this scripts works fine on Win98client using Novell server. I've another client using Win2k server. My issue is that I'm not output username to a file as the command %username% is not possible (correct me if I'm wrong) windows 98. Is there any way I can output it using KiXtart. My main scipt is running KiXtart. Below is a copy of the scripts.Thanks

@ECHO OFF

if exist c:\media9.txt goto end

copy \\mda_fs2\IT_support\software\wm9\media9.txt c:\ /y

rem del c:\media9.txt

rem c:\windows\system\msiexec /i \\mda_fs2\it_support\software\wm9\mpsetupedp.msi

regedit /s m:\software\wm9\media9\MP9\media9.reg

rem regedit /s \\mda_fs2\software\wm9\media9.reg

rem DIR C:\"Program Files"\"Windows Media Player"\"wmplayer.exe" >> \\mda_fs2\IT_support\software\wm9\%USER%.TXT

:end
exit

Top
#42753 - 2003-07-11 11:47 AM Re: Output Username to file
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4673
Loc: The Netherlands
Username is available by using the @USERID macro in kix.

code:
ReDirectOutput("c:\filename.txt",0) > NUL
? @USERID

This creates a file called filename.txt on c: with the username in it.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#42754 - 2003-07-11 11:50 AM Re: Output Username to file
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, translated your batch to script.
why use batch when you can simply do it with kix:
code:
if exist("c:\media9.txt") exit 0 endif

copy "\\mda_fs2\IT_support\software\wm9\media9.txt" "c:\"
shell "regedit /s m:\software\wm9\media9\MP9\media9.reg"

shell '%comspec% /c DIR C:\"Program Files"\"Windows Media Player"\"wmplayer.exe" >> \\mda_fs2\IT_support\software\wm9\'+@userid+'.TXT'

_________________________
!

download KiXnet

Top
#42755 - 2003-07-11 01:06 PM Re: Output Username to file
zerhyr Offline
Lurker

Registered: 2003-07-10
Posts: 3
Ok thanxs a lot. I'll try the script. But first I'll need to understand the script. Will need to do some reading first.
Top
#42756 - 2003-07-18 02:22 AM Re: Output Username to file
zerhyr Offline
Lurker

Registered: 2003-07-10
Posts: 3
Ok I've tried the scripts. It works great. thanks a lot guys..
Top
#42757 - 2003-07-18 02:58 AM Re: Output Username to file
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
yeah.
just like it should [Wink]
_________________________
!

download KiXnet

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 2870 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.058 seconds in which 0.028 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