Page 1 of 1 1
Topic Options
#198080 - 2010-03-17 02:30 AM Please Help
Grantcrowe Offline
Just in Town

Registered: 2010-03-17
Posts: 3
Loc: New Zealand
Hello all,

I'm trying to create a line of *.kix script that adds a environmental path to the already exciting path, so far i have

If InGroup ("Help Workshop")
$path = "C:\Program Files\Help Workshop;" + $path
WriteValue($key,"Path",$path,"REG_EXPAND_SZ")
EndIf

at the moment its not working for 2 reasons,
1) its adds the path to the end of the path but it doesn't add the "" so its only looking in c:\program
2) it keeps adding C:\Program Files\Help Workshop every time i log in so now it looks like

C:\Program Files\Help Workshop; C:\Program Files\Help Workshop; C:\Program Files\Help Workshop

can anyone help me please?

Top
#198083 - 2010-03-17 06:16 AM Re: Please Help [Re: Grantcrowe]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
Pseudo code to get you going.
 Code:
if not instr(readvalue($key,"Path"),"C:\Program Files\Help Workshop")
  $path = '"C:\Program Files\Help Workshop";' + $path
  $RC=writevalue($key,"Path",$path,"REG_EXPAND_SZ")
endif

Top
#198086 - 2010-03-17 08:09 PM Re: Please Help [Re: Allen]
Grantcrowe Offline
Just in Town

Registered: 2010-03-17
Posts: 3
Loc: New Zealand
thank you very much it works are far as putting the "" around the path so my only issue now is every time i log in it adds it to the end?

Microsoft Windows [Version 5.2.3790]
(C) Copyright 1985-2003 Microsoft Corp.

C:\Documents and Settings\gtest>path
PATH=C:\itools;D:\itools;I:\itools;I:\applications;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;"c:\Program Files (x86)\winzip";C:\WINDOWS\system32\WindowsPowerShell\v1.0;C:\WINDOWS\system32\WindowsPowerShell\v1.0;"C:\Program Files\Help Workshop";"C:\Program Files\Help Workshop";"C:\Program Files\Help Workshop";"C:\Program Files\Help Workshop";

C:\Documents and Settings\gtest>

any answers?

If InGroup ("Help Workshop")
INSTR(readvalue($key,"Path"),"C:\Program Files\Help Workshop")
$path = '"C:\Program Files\Help Workshop";' + $path
$RC=writevalue($key,"Path",$path,"REG_EXPAND_SZ")

ENDIF


Edited by Grantcrowe (2010-03-17 11:09 PM)

Top
#198089 - 2010-03-18 01:40 AM Re: Please Help [Re: Grantcrowe]
Allen Administrator Online   shocked
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
Look at my example again.
Top
#198090 - 2010-03-18 02:08 AM Re: Please Help [Re: Allen]
Grantcrowe Offline
Just in Town

Registered: 2010-03-17
Posts: 3
Loc: New Zealand
all done

thank you for your help

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 469 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

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