registry based scripting to change name based on key's content 
Author Message
 registry based scripting to change name based on key's content

I've got a virtual drive emulator which after install
gives itself a drive letter based on whats free.

the key puts itself under
HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices

the values called "\DosDevices\E:"

Unfortunatly it wont be the same to every PC on the
network.

we want a standard across the network of this virtaul
drive of H:

being a simpleminded man, i would like to make up a
script, i would prefer kix, but vbs will do.

the hex data contained within the key is the same on all
machines, so using that, can i delete all known instances
of \DosDevices\#: that contain the data of

5c003f003f005c00530043005300490023004300640052006f006d00260
0560065006e005f005a00540065006b0057006100720065002600500072
006f0064005f005f004f0043004400450026005200650076005f0031002
e0030003000230031002600320061006600640037006400360031002600
3000260030003000300023007b003500330066003500360033003000640
02d0062003600620066002d0031003100640030002d0039003400660032
002d003000300061003000630039003100650066006200380062007d00

so i can reinsert the value that i've made up in kix.

can anyone help?



Sat, 21 May 2005 20:19:19 GMT  
 registry based scripting to change name based on key's content

Quote:

> I've got a virtual drive emulator which after install
> gives itself a drive letter based on whats free.

> the key puts itself under
> HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices

> the values called "\DosDevices\E:"

> Unfortunatly it wont be the same to every PC on the
> network.

> we want a standard across the network of this virtaul
> drive of H:

> being a simpleminded man, i would like to make up a
> script, i would prefer kix, but vbs will do.

> the hex data contained within the key is the same on all
> machines, so using that, can i delete all known instances
> of \DosDevices\#: that contain the data of

> 5c003f003f005c00530043005300490023004300640052006f006d00260
> 0560065006e005f005a00540065006b0057006100720065002600500072
> 006f0064005f005f004f0043004400450026005200650076005f0031002
> e0030003000230031002600320061006600640037006400360031002600
> 3000260030003000300023007b003500330066003500360033003000640
> 02d0062003600620066002d0031003100640030002d0039003400660032
> 002d003000300061003000630039003100650066006200380062007d00

> so i can reinsert the value that i've made up in kix.

> can anyone help?

Is "E" (or whatever letter) the  *only* value under this key?  If it is then
it's as simple as importing a .REG file that looks like so:

***File Start ****
REGEDIT4

[-HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\DosDevices]

***File end****

Note the - in front of HKEY:  this means to remove that key and all its
subkeys.
Also note the blank line before the end of the file, this is *IMPORTANT*;
regedit imports fail without the extra blank line.  I have no idea why, I
just know that's the case I keep forgetting about :-).

You can then reinsert your desired H: value.

A slightly harder version, if the drive letter is not the only key/value in
this registry branch, is to create a regedit file like so:
***File Start ****
REGEDIT4

[-HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\DosDevices\E]

[-HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\DosDevices\F]

[-HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\DosDevices\G]

and so on, and so on,
[-HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices\DosDevices\Z]

***File end****

You can then reinsert your desired H: value.

This shouldn't take more than a split second to run, no matter which method
you use.  Registry searching/parsing/etc with VBS will probably push you
over the subsecond timeframe, if not into multi-second run times.



Sat, 21 May 2005 23:02:44 GMT  
 registry based scripting to change name based on key's content
the problem is,

the software gets given a drive letter by windows and i
can't do nothing about that. but i want it to be H.

i found it under local machine\system\mounted devices\

all the drives are under here.

the data in the value is unique on any devices and as the
cd emulator software is unique, each machine therfore has
the same data with in the value for that drive.

But the name "\dosdevices\#" will change pending on the
usage of drives.

so as said i need a script that will only remove the drive
for the cd emulator, it will have to discover it only by
the data within the value rather than the name of the
value, as its value name may be anything from
\dosdevices\d to \dosdevices\z in my case.

i can add key fine, but its removing keys based on
data/content of the value, which is a binary/hex value.



Sat, 21 May 2005 23:29:12 GMT  
 registry based scripting to change name based on key's content

the resolution with the thanks of ned

  ocde.txt
3K Download


Sun, 22 May 2005 21:59:06 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Modify registry key with UNC'name

2. Converting from 10 base to a 16 base number

3. resize window based on contents

4. Rename files based on content.

5. rename a file based on content

6. I have a problem : registry base and outlook signature

7. PB : registry base and outlook signature

8. change registry key permission with script?

9. find a value in a registry based

10. change registry key permission with script?

11. change registry key permission with script?

12. change registry key permission with script?

 

 
Powered by phpBB® Forum Software