Page 2 of 3 <123>
Topic Options
#28961 - 2002-09-13 11:18 PM Re: Copying Shortcut
Jack Lothian Offline
MM club member
*****

Registered: 1999-10-22
Posts: 1169
Loc: Ottawa,Ontario, Canada
I believe Les is giving you a cryptic hint. I think the problem may be the current user hive in the registry & the current user profile does not exist in Win9x until after logon fully completes. The Runonce key runs after logon completes not during the logon script. So create a second bat file that does the copying then poke the name & location of this second bat file into runonce key in the registry. It will execute when the user profile is active.

What type of profiles/polocies are you using?

[ 13. September 2002, 23:24: Message edited by: Jack Lothian ]
_________________________
Jack

Top
#28962 - 2002-09-13 11:19 PM Re: Copying Shortcut
GRF Offline
Fresh Scripter

Registered: 2002-02-15
Posts: 45
Loc: Ohio
Sorry, here is more. $icon98 is a variable that equals your file name. If exist = 0 means it isn't there, so it copies it. My code didn't quite post properly.
code:
$Icon98 = "C:\windows\DESKTOP\ESI.PIF"
if exist ($icon98) = 0
copy "q:\esi98.pif" "C:\windows\desktop\ESI.pif"
endif

GF
_________________________
GF

Top
#28963 - 2002-09-13 11:36 PM Re: Copying Shortcut
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Just to be on the save side, put the call to the batch file that calls the KiXtart script with the link copy routine into HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce and NOT into the HKEY_CURRENT_USER subkey! This guarantee execution of the RunOnce independend of whether the HKEY_CURRENT_USER profile is already loaded or not.
_________________________
There are two types of vessels, submarines and targets.

Top
#28964 - 2002-09-16 02:40 PM Re: Copying Shortcut
Kathy Offline
Getting the hang of it

Registered: 2002-09-09
Posts: 96
Loc: Marshall, TX
So on the value in the registery I can put:
\\server\netlgon\short.bat (that has the copy command in the file)?

Thanks for all your help.
_________________________
Stupid is forever - Ignorance can be fixed.

Top
#28965 - 2002-09-16 04:19 PM Re: Copying Shortcut
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Yes, but nost likely the folder is called NETLOGON and not NETLGON, however, that might be a type.
_________________________
There are two types of vessels, submarines and targets.

Top
#28966 - 2002-09-16 04:48 PM Re: Copying Shortcut
Kathy Offline
Getting the hang of it

Registered: 2002-09-09
Posts: 96
Loc: Marshall, TX
Not to good a typist. That worked on my local Win98 PC. Thanks... Now is there a way I can use INGROUP and change the settings on user's registries if they are in the group that needs the icon or is this way to difficult for a beginner like me?
_________________________
Stupid is forever - Ignorance can be fixed.

Top
#28967 - 2002-09-16 04:52 PM Re: Copying Shortcut
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Just use a succession of IF INGROUP to make appropriate changes
code:
IF INGROUP(Group A')
; do stuff
ENDIF
IF INGROUP('Group B')
; do other sutff
ENDIF

Alternatively, if the groups are mutually exclusive, then you cna also use SELECT-CASE-ENDSELECT like
code:
SELECT
CASE INGROUP('Group A')
; do stuff
CASE INGROUP('Group B')
; do other stuff
CASE 1
; do stuff for members of neither Group A nor Group B
ENDSELECT

_________________________
There are two types of vessels, submarines and targets.

Top
#28968 - 2002-09-16 07:36 PM Re: Copying Shortcut
Kathy Offline
Getting the hang of it

Registered: 2002-09-09
Posts: 96
Loc: Marshall, TX
Do you have a copy of a script that will show me how to add to the RUNONCE registry settings to the Win98 PCs?
_________________________
Stupid is forever - Ignorance can be fixed.

Top
#28969 - 2002-09-16 07:44 PM Re: Copying Shortcut
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
something like:
writevalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce","run_me","yourcopy_command","REG_SZ")

[ 16. September 2002, 19:45: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#28970 - 2002-09-16 07:49 PM Re: Copying Shortcut
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
For Windows 9x:
code:
$rc=writevalue('HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce','AppName','AppToRun','REG_SZ')

_________________________
There are two types of vessels, submarines and targets.

Top
#28971 - 2002-09-16 07:51 PM Re: Copying Shortcut
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
jens, aint that just the same? [Roll Eyes]
_________________________
!

download KiXnet

Top
#28972 - 2002-09-16 08:08 PM Re: Copying Shortcut
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
I lagged in posting while trying to do two things at the same time, namely eat lunch and type [Wink]
_________________________
There are two types of vessels, submarines and targets.

Top
#28973 - 2002-09-16 08:17 PM Re: Copying Shortcut
Kathy Offline
Getting the hang of it

Registered: 2002-09-09
Posts: 96
Loc: Marshall, TX
I read some links on LOADKEY and I came up with the following code. When I run it it says missing comma. Where. Will this work?

if ingroup("TX Mapcon Test")
Use O: /delete /PERSISTENT
USE O: "\\server\Apps\Apps"/PERSISTENT
LOADKEY (HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\RunOnce
\ICON, "ICON"="\\\\server\\netlogon\\short.bat")

endif
exit
_________________________
Stupid is forever - Ignorance can be fixed.

Top
#28974 - 2002-09-16 08:22 PM Re: Copying Shortcut
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
Kathy:

Please read the KiXtart Manual!

LOADKEY loads a registry key from a file. It does not write a registry value into the registry!

Thus, you are using a) incorrect LOADKEY syntax, b) incorrect command, c) did not check what both Lonkero and I posted per your request.
_________________________
There are two types of vessels, submarines and targets.

Top
#28975 - 2002-09-16 08:23 PM Re: Copying Shortcut
Kathy Offline
Getting the hang of it

Registered: 2002-09-09
Posts: 96
Loc: Marshall, TX
LONKERO: Thanks that did it!
_________________________
Stupid is forever - Ignorance can be fixed.

Top
#28976 - 2002-09-16 08:28 PM Re: Copying Shortcut
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
heh, thanks to jens for clarification [Big Grin]
_________________________
!

download KiXnet

Top
#28977 - 2002-09-16 08:40 PM Re: Copying Shortcut
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11162
Loc: Boston, MA, USA
I am tempted to say 'We applied a fix' but that would be inconsiderate though fitting considering Kathy's footer. [Wink]

Kathy: Glad we got it working now.

[ 16. September 2002, 20:41: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.

Top
#28978 - 2002-09-16 08:42 PM Re: Copying Shortcut
Kathy Offline
Getting the hang of it

Registered: 2002-09-09
Posts: 96
Loc: Marshall, TX
I lied. I deleted the key and then rebooted and logged in. Did not put the change in the registry and did not load the shortcut.
_________________________
Stupid is forever - Ignorance can be fixed.

Top
#28979 - 2002-09-16 08:48 PM Re: Copying Shortcut
Kathy Offline
Getting the hang of it

Registered: 2002-09-09
Posts: 96
Loc: Marshall, TX
Hey guys, when I run kix32 xxx from command line with the writevalue statement like you posted in the forum I get a 0 ZERO showing on the screen. What is that?

The code below is what I am running.
Kixtart 4.11 win98 users win2k servers
if ingroup("Test")
Use O: /delete /PERSISTENT
USE O: "\\server\Apps\Apps"/PERSISTENT
writevalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce","icon","\\server\netlogon\start.bat","REG_SZ")
_________________________
Stupid is forever - Ignorance can be fixed.

Top
#28980 - 2002-09-16 09:01 PM Re: Copying Shortcut
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
this is easy.
all functions have return value.

normally, 0 means that function was successfull.

from the functions description (manual) you see what it returns.

if you put $nul= or $rc= (like jens did) before the writevalue, it does not output it anymore.
_________________________
!

download KiXnet

Top
Page 2 of 3 <123>


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 173 anonymous users online.
Newest Members
EricMyers, siddharthinfosy, raynebc, MasterNinjaSkar, hienttt
17516 Registered Users

Generated in 0.208 seconds in which 0.102 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