Page 1 of 1 1
Topic Options
#153280 - 2005-12-13 08:40 AM Problem minimizing a programgroup
AlfP Offline
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 Administrator Offline
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 Offline
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
#153283 - 2005-12-13 02:37 PM Re: Problem minimizing a programgroup
DrillSergeant Offline
MM club member
*****

Registered: 2004-07-09
Posts: 1164
Loc: Eijsden, the Netherlands
$startMenu_programs = readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","programs")
MD $startMenu_programs + "\testGroup"
copy "%netlogon%\links\testGroup\notepad.lnk" $startMenu_programs+"\testgroup"

the variable $startMenu_programs misses a t in the second and third line
_________________________
The Code is out there

Top
#153284 - 2005-12-13 02:57 PM Re: Problem minimizing a programgroup
AlfP Offline
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
#153285 - 2005-12-13 03:07 PM Re: Problem minimizing a programgroup
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ja.
use expand:
Code:

$startMenu_programs = readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders","programs")
$starMenu_programs = expandEnvironmentVars($starMenu_programs)
? $starMenu_programs

_________________________
!

download KiXnet

Top
#153286 - 2005-12-13 03:29 PM Re: Problem minimizing a programgroup
AlfP Offline
Lurker

Registered: 2005-12-13
Posts: 4
Jooel

Now it works perfectly!

Thanks for your help!

regards
Alf

Top
#153287 - 2005-12-13 03:53 PM Re: Problem minimizing a programgroup
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
damn.
I did the missing T thing again!

sorry for that anyways.
_________________________
!

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 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.063 seconds in which 0.031 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