Page 1 of 1 1
Topic Options
#136289 - 2005-03-24 11:55 AM Problem with Pathmod Script
captaincrash0815 Offline
Fresh Scripter

Registered: 2005-03-16
Posts: 5
Hello.

I have a problem with pathmod. When i start my pc, kix change the path. Thats OK. But when i start the pc next time, i cannot use net use or regedit in the dos cmd. Any Idea ?

Top
#136290 - 2005-03-24 12:52 PM Re: Problem with Pathmod Script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
this is the same problem you had before, no?

what you mean you can't use "net use"?
_________________________
!

download KiXnet

Top
#136291 - 2005-03-24 03:21 PM Re: Problem with Pathmod Script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
I would surmize that you are destroying the existing path rather than appending to it but without seeing any code, I can only surmize. Since Johnny died, my Carnac hat doesn't work any more and my crystal ball is in the shop.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#136292 - 2005-03-24 03:29 PM Re: Problem with Pathmod Script
Anonymous
Unregistered


OK. Here is the code. On 150 PC's the path variable is dead. The Value that i want to change is right and programm runs but the commands net use,regedit,cmd... are dead. Please Help
Code:

$CValue = "\\rassmus\terawin\system"
$RValue = "\\geodaten\terawin\system\"
$RC1 = PathMod($CValue, $RValue)

$CValue = "\\rassmus\terawin\system\"
$RC2 = PathMod($CValue, $RValue)

; $CValue = "\\geodaten\terawin\system\"
; $RValue = "\\geodaten\terawin\system"
$RC3 = PathMod($CValue, $RValue)

; Rckgabewerte :
; 0 Eintrag wurde gefunden und Pfad wird ge„ndert
; 1 Fehler : Eintrag konnte nicht geschrieben werden
; 2 $CValue wurde nicht gefunden oder ist leer
; 3 $RValue wurde nicht gefunden oder ist leer
;
Function PathMod($CValue, $RValue)
Dim $Array, $aCntr, $KeyVal2, $fCntr, $stat, $KeyLoc, $Keynam
$aCntr = 0
$fCntr = 0
$stat = "FALSE"
$KeyLoc = "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
$keyNam = "Path"

If $CValue = "" OR $RValue = ""
Select
Case $CValue = ""
$Pathmod = 2
Case $RValue = ""
$Pathmod = 3
EndSelect
Return
EndIf

$KeyVal = ReadValue ($KeyLoc, $KeyNam)
$RegType = READTYPE($KeyLoc,$KeyNam)
$Array = Split($KeyVal,";",-1)
For Each $Element In $Array
If $Element = $CValue
$Array[$acntr] = $RValue
$stat = "TRUE"
EndIf
$acntr = $acntr + 1
Next

If $Stat = "TRUE"
For Each $Element In $Array
If $fCntr = 0
$KeyVal2 = $element
$fcntr = 1
Else
$keyVal2 = $KeyVal2 +";"+ $Element
$fcntr = $fcntr + 1
EndIf
Next

$RC = WriteValue($Keyloc,$KeyNam,$KeyVal2,"REG_EXPAND_SZ")

; $RC = WriteValue($Keyloc,$KeyNam,$KeyVal2,$REGTYPE) // Wegen Problem ausnahmsweise auf REG_EXPAND_SZ .....
; SETM "Path=$KeyVal2"
If $RC = 0
$PathMod = 0
Return
Else
$Pathmod = 1
Return
EndIf
EndIf
EndFunction



added code tags - Bullock


Edited by Howard Bullock (2005-03-24 04:08 PM)

Top
#136293 - 2005-03-24 03:48 PM Re: Problem with Pathmod Script
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Please use code tags when posting code and also post what the path was befor it got mucked up and after.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#136294 - 2005-03-24 04:49 PM Re: Problem with Pathmod Script
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
resetting path you said?
Code:
;		SETM "Path=$KeyVal2"

_________________________
!

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
1 registered (Allen) and 382 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

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