Page 1 of 1 1
Topic Options
#117880 - 2004-04-14 06:05 PM Copy and @userid variable
schnorbitz Offline
Lurker

Registered: 2003-07-17
Posts: 2
am a relative newbie with Kix and I need to update a file on all PC's across the WAN. For the XP/2000 machines it's fine as I can call a batch file which allows me to use the %username% variable. I can't use this method to copy the file onto 98 machines as the variable isn't recognised. So I've been trying to do it via the login script - without any success!! My code (which is probably rubbish) is :-

; replace pn.ini on 9x clients
if ingroup("Citrix_pn")
If @InWin = 2
copy "\\server\netlogon\pn.ini" "c:\windows\profiles\" +@userid+ "\application data\icaclient"
endif
endif

Any help would be gratefully received.

Thanks

Top
#117881 - 2004-04-14 06:26 PM Re: Copy and @userid variable
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
What does @Error and @SError return? Have you tried stepping through in debug mode?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#117882 - 2004-04-14 06:56 PM Re: Copy and @userid variable
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
Instead of hard-coding the destination path, maybe you could use fnGetSpecialFolder() - Returns the path of a Windows Special Folder to retrieve the Application Data folder and append the rest of the path to it...

Code:

; replace pn.ini on 9x clients
if ingroup("Citrix_pn")
If @InWin = 2
$sAppData= fnGetSpecialFolder("AppData") + "\icaclient"
copy "\\server\netlogon\pn.ini" $sAppData
endif
endif



Top
#117883 - 2004-04-14 07:06 PM Re: Copy and @userid variable
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Chris,
Do you know if that function is immune to load order issues on Wintendos with profiles?

Also, must ensure that WSH is installed since Wintendos do not have it by default.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#117884 - 2004-04-14 07:43 PM Re: Copy and @userid variable
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
It should return the Application Data folder for the current user. AFAIK, it should work with a Wintendo with profiles.

As far as WSH in concerned, he did mention that the target audience is Windows 98, which does have WSH installed. The methods in my function require v1.0 of WSH, so that should be good for any client with WSH installed.

Regarding the scriptlet in general, if I were doing it, I would add more error checking and verify that the paths exists before copying.

Top
#117885 - 2004-04-14 09:27 PM Re: Copy and @userid variable
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11634
Loc: Space
This version should not require WSH

GetSpecialFolders() - Returns the Name and Path of Special Folders

Top
#117886 - 2004-04-14 10:24 PM Re: Copy and @userid variable
Chris S. Offline
MM club member
*****

Registered: 2002-03-18
Posts: 2368
Loc: Earth
But won't work with 9x.
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 2333 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.058 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