Page 1 of 1 1
Topic Options
#99155 - 2003-03-07 09:06 AM Problem: Changing Drive label
Suprimus Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 9
Hi, having a problem changing the label on mapped drives.

Currently I'm changing it by changing it in registry:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\_LabelFromReg\Version
and
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\_LabelFromReg\Cache

it works nice, BUT I need to open up explorer!!
This makes it very difficult to change the drive label without either delaying the script, or continue the script without the change.

Anyone know a workaround?
Is it possible to create the registry records yourself?

Thx for all help [Smile]
Suprimus

Top
#99156 - 2003-03-07 09:14 AM Re: Problem: Changing Drive label
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I think:
http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=12;t=000163

has the answer.
it YAMD() udf which handles the label...

not sure do you want to change only the mapped drives or also local...
_________________________
!

download KiXnet

Top
#99157 - 2003-03-07 09:28 AM Re: Problem: Changing Drive label
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
You could also try my UDF:
http://www.kixtart.org/board/ultimatebb.php?ubb=get_topic;f=12;t=000308

Works on W2k only...
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#99158 - 2003-03-07 09:29 AM Re: Problem: Changing Drive label
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
sorry patrick, missed that totally!
_________________________
!

download KiXnet

Top
#99159 - 2003-03-07 09:36 AM Re: Problem: Changing Drive label
Suprimus Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 9
Thx for the responses, but they don't solve my problem [Frown]

The registry entries are made only when you open up the explorer.

They don't exist before you actually opens up the explorer.

And since I have a similar function to the YAMD() (too bad I didn't see that one earlier [Smile] ) the execution of the script stops where you try to update the label or skips it.

Suprimus

Top
#99160 - 2003-03-07 10:05 AM Re: Problem: Changing Drive label
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
I use it during logon, so no open explorer first...

Not sure what's the problem...
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#99161 - 2003-03-07 10:15 AM Re: Problem: Changing Drive label
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
wait a sec...
I have another one for you to try in just few seconds.
it uses explorer's internal call so it must work.
_________________________
!

download KiXnet

Top
#99162 - 2003-03-07 10:19 AM Re: Problem: Changing Drive label
Suprimus Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 9
Hmm strange, tried your script here, but got no update.

Well I made a small script to fix the problem, well except one of he registry variables I don't know what value to use, so I used a the value that was in my registry.

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints\I\_LabelFromReg\LastUpdate
It is a DWORD value, and I'm putting in 344290293.

Anyone know how to calculate the value I should use?

Hmm having problems pasting my code, HTML error??
Suprimus

Top
#99163 - 2003-03-07 10:22 AM Re: Problem: Changing Drive label
Suprimus Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 9
thx Jooel [Big Grin]
Top
#99164 - 2003-03-07 10:22 AM Re: Problem: Changing Drive label
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
suprimus, try the newist UDF:
http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000369
_________________________
!

download KiXnet

Top
#99165 - 2003-03-07 10:26 AM Re: Problem: Changing Drive label
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, the dep is wrong...
it actually is now only compliant with w2k, ME and XP...

I try to recode it to be more understanding...
_________________________
!

download KiXnet

Top
#99166 - 2003-03-07 10:47 AM Re: Problem: Changing Drive label
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, currently can't figure out a way.
someone could allthough write this with FSO-object as it should also have the label.
_________________________
!

download KiXnet

Top
#99167 - 2003-03-07 11:02 AM Re: Problem: Changing Drive label
Suprimus Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 9
code:
		$rc=readvalue("$labelkey\$DriveLetter\_LabelFromReg","Cache")				
if @error or $rc=""; or $timeout<5
$rc=readvalue("$labelkey","$DriveLetter")
if @error or $rc=""
$rc=addkey("$labelkey\$DriveLetter")
sleep(1)
endif
$rc=readvalue("$labelkey\$DriveLetter","_LabelFromReg")
if @error or $rc=""
$rc=addkey("$labelkey\$DriveLetter\_LabelFromReg")
sleep(1)
endif
endif
$rc=writevalue("$labelkey\$DriveLetter\_LabelFromReg","Version","3",REG_DWORD)
$rc=writevalue("$labelkey\$DriveLetter\_LabelFromReg","LastUpdate","344290293",REG_DWORD)
$rc=writevalue("$labelkey\$DriveLetter\_LabelFromReg","Cache","$hexlabel",REG_BINARY)

I made this code and it looks like it works, but I need the LastUpdated value calculated.

Any ideas

Top
#99168 - 2003-03-07 11:05 AM Re: Problem: Changing Drive label
MightyR1 Offline
MM club member
*****

Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
Delete the version entry like I do in my UDF. Then Lastupdate wil be recalculated automatically...
_________________________
Greetz,
Patrick Rutten

- We'll either find a way or make one...
- Knowledge is power; knowing how to find it is more powerful...
- Problems don't exist; they are challenges...

Top
#99169 - 2003-03-07 11:15 AM Re: Problem: Changing Drive label
Suprimus Offline
Fresh Scripter

Registered: 2002-07-23
Posts: 9
Yeah it worked,

thx for the help guys [Big Grin]

Top
Page 1 of 1 1


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

Who's Online
0 registered and 1824 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.099 seconds in which 0.067 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