#153280 - 2005-12-13 08:40 AM
Problem minimizing a programgroup
|
AlfP
Lurker
Registered: 2005-12-13
Posts: 4
|
Hi everyone
Can anyone explain to me why the programgroup isn't minimized in this scriptsequence?
Code:
$ReturnCode=ADDPROGRAMGROUP("Testgroup", 0) If $ReturnCode = 0 ? "---> Testgroups-grupp:" $ReturnCode=SHOWPROGRAMGROUP("Testgroup", 2, 0) if $ReturnCode = 0 $ReturnCode=ADDPROGRAMITEM('"C:\Windows\system32\notepad.exe"', "Notepad", "", 0, "", 0, 0) Endif $ReturnCode=SHOWPROGRAMGROUP("Testgroup", 6, 0) ? "ReturnCode = " + $ReturnCode Endif
On my computers (I have tried several) I always get a Returncode = 0, but the programgroup isn't minimized!
I'll be greatful for any help!
Regards Alf
|
|
Top
|
|
|
|
#153281 - 2005-12-13 11:29 AM
Re: Problem minimizing a programgroup
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
I remember having similar trouble. I always blamed the faulty windows API and gave it no more thought when some of the functionality didn't work.
hmm, guess this should be finally revisited.
anyway, you can always do it silently without showing the group at all: Code:
$startMenu_programs = readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","programs") MD $starMenu_programs + "\testGroup" copy "%netlogon%\links\testGroup\notepad.lnk" $starMenu_programs+"\testgroup"
tried to made a really short example, so this one needs the link (shortcut) file to be already created somewhere.
hmm... actually. looking at some older code: http://www.kixtart.org/UDF/UDF_lister.php?what=post&code=82353
you don't need to show the programgroup. thus the code can be: Code:
$startMenu_programs = readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","programs") MD $starMenu_programs + "\testGroup" $ReturnCode=ADDPROGRAMITEM('"C:\Windows\system32\notepad.exe"', "Notepad", "", 0, "", 0, 0) MOVE $starMenu_programs+"\notepad.lnk" $starMenu_programs+"\testgroup\notepad.lnk"
_________________________
!download KiXnet
|
|
Top
|
|
|
|
#153282 - 2005-12-13 02:23 PM
Re: Problem minimizing a programgroup
|
AlfP
Lurker
Registered: 2005-12-13
Posts: 4
|
Jooel
It seems as your code should work, but there seems to be a problem with the MB command. If the map already exists, the rest of the code works perfect, but I can't figure out why the MD doesn't!
Could someone help me out please 
Regards Alf
|
|
Top
|
|
|
|
#153284 - 2005-12-13 02:57 PM
Re: Problem minimizing a programgroup
|
AlfP
Lurker
Registered: 2005-12-13
Posts: 4
|
I must be blind, becouse I messed that t ....
On the other hand, the code still doesn't work  If I read out the value of $startMenu_programs I get %USERPROFILE%\Start-Meny\Program
If I use MD "C:\Documents and Settings\ALF\Start-Meny\Program\Test2" in the same script, the Test2 map is created but not the testGroup map.
Is it possible that the variable %USERPROFILE% isn't converted correctly?
Regards Alf
|
|
Top
|
|
|
|
#153286 - 2005-12-13 03:29 PM
Re: Problem minimizing a programgroup
|
AlfP
Lurker
Registered: 2005-12-13
Posts: 4
|
Jooel
Now it works perfectly!
Thanks for your help!
regards Alf
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 2220 anonymous users online.
|
|
|