#99155 - 2003-03-07 09:06 AM
Problem: Changing Drive label
|
Suprimus
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 Suprimus
|
|
Top
|
|
|
|
#99159 - 2003-03-07 09:36 AM
Re: Problem: Changing Drive label
|
Suprimus
Fresh Scripter
Registered: 2002-07-23
Posts: 9
|
Thx for the responses, but they don't solve my problem
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 ) the execution of the script stops where you try to update the label or skips it.
Suprimus
|
|
Top
|
|
|
|
#99162 - 2003-03-07 10:19 AM
Re: Problem: Changing Drive label
|
Suprimus
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
Fresh Scripter
Registered: 2002-07-23
Posts: 9
|
thx Jooel
|
|
Top
|
|
|
|
#99164 - 2003-03-07 10:22 AM
Re: Problem: Changing Drive label
|
Lonkero
KiX Master Guru
   
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
|
|
Top
|
|
|
|
#99167 - 2003-03-07 11:02 AM
Re: Problem: Changing Drive label
|
Suprimus
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
|
|
|
|
#99169 - 2003-03-07 11:15 AM
Re: Problem: Changing Drive label
|
Suprimus
Fresh Scripter
Registered: 2002-07-23
Posts: 9
|
Yeah it worked,
thx for the help guys
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 5421 anonymous users online.
|
|
|