#53670 - 2001-02-07 05:51 PM
desk top icon for mapped drives
|
Anonymous
Anonymous
Unregistered
|
can anyone tell me how to (using kixtart) create a icon on the users desk top for each of the mapped drives, can kixtart do this.
|
|
Top
|
|
|
|
#53672 - 2001-02-09 12:36 AM
Re: desk top icon for mapped drives
|
Anonymous
Anonymous
Unregistered
|
I am looking for a shortcut
|
|
Top
|
|
|
|
#53673 - 2001-02-08 02:12 PM
Re: desk top icon for mapped drives
|
Anonymous
Anonymous
Unregistered
|
Hya Jim..,Try this for size.. It will create for every mapped networkdrive a shortcut on your desktop. code:
CLS BREAK ON $DriveLetterCHAR=67 WHILE $DriveLetterCHAR=>65 AND $DriveLetterCHAR=<90 $DriveLetter=CHR($DriveLetterCHAR)+":" IF EXIST($DriveLetter) SHELL'%ComSpec% /C NET USE $DriveLetter>c:\temp\NetUSe_$DriveLetterCHAR.dat' CLS ENDIF $NULL=OPEN(1,"c:\temp\NetUSe_$DriveLetterCHAR.dat") $LINE1=READLINE(1) $NULL=CLOSE(1) IF INSTR($LINE1,"Local name")<>0 AT(02,02)"Drive : "$DriveLetter AT(04,02) $CLSID="{AAAAAAAA-0000-0000-0000-0000000000"+$DriveLetterCHAR+"}" $LinkName=$DriveLetter+" [Network]" $Command="%SystemRoot%\Explorer.exe "+$DriveLetter $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\DefaultIcon") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\InProcServer32") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell\Connect") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell\Connect\Command") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx\PropertySheetHandlers") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx\PropertySheetHandlers\$CLSID") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx\ShellFolder") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID","",$LinkName,"REG_SZ") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\DefaultIcon","","%SystemRoot%\System32\Shell32.dll,9","REG_SZ") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\InProcServer32","","shell32.dll","REG_SZ") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\InProcServer32","ThreadingModel","Apartment","REG_SZ") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell\Connect\Command","",$Command,"REG_SZ") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellFolder","Attributes","0","REG_DWORD") $NULL=addkey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\$CLSID") ENDIF $DriveLetterCHAR=$DriveLetterCHAR+1 LOOP DEL"c:\temp\NetUSe_*.dat"
Warring this is a very brute way to create shortcuts..!!------------------ To Be Of Service.., Fabian. -----------------Paranoia is reality on a finer scale----------------- [This message has been edited by Fabian (edited 08 February 2001).]
|
|
Top
|
|
|
|
#53676 - 2001-02-08 03:01 PM
Re: desk top icon for mapped drives
|
Anonymous
Anonymous
Unregistered
|
Forgot to tell you that I am trying to create a shortcut for mapped drives with windows 98 workstations
|
|
Top
|
|
|
|
#53677 - 2001-02-08 03:07 PM
Re: desk top icon for mapped drives
|
Anonymous
Anonymous
Unregistered
|
Hya Shawn..,Thx.. if you Replace "..\Explorer\Desktop\NameSpace" with "..\Explorer\MyComputer\NameSpace" you get the same thing in "MyComputer".. funny isn't it..!?
|
|
Top
|
|
|
|
#53678 - 2001-02-08 03:44 PM
Re: desk top icon for mapped drives
|
Anonymous
Anonymous
Unregistered
|
Fabian that did not work I am using 98 workstations
|
|
Top
|
|
|
|
#53680 - 2001-02-08 04:58 PM
Re: desk top icon for mapped drives
|
Anonymous
Anonymous
Unregistered
|
Hya Folks..,Yes.. you could create 'normale' shortcuts (.lnk) in an central place and copy them to every user desktop.., BUT!! beware of the use of UNC paths in shortcuts who uses files (.ico, .exe, etc) from locations like %SystemRoot% and so.. (check this with a HexViewer) If you copy such a shortcut to other users.. their systems will allways check the network accessablility of the Original shortcut locations and associations..!! Beware..!! PS.. I forgot.. I have updated the script above to function on Win9x as well..!? Cya..!! ------------------ To Be Of Service.., Fabian. -----------------Paranoia is reality on a finer scale----------------- [This message has been edited by Fabian (edited 08 February 2001).]
|
|
Top
|
|
|
|
#53681 - 2001-02-09 05:19 AM
Re: desk top icon for mapped drives
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
Here is a slight modification to Fabian's script. It places Icons for all drives (local and network) and removes the ones that are no longer present (disconnected)never let a good script go unmodified... code:
CLS BREAK ON $DriveLetterCHAR=67 WHILE $DriveLetterCHAR=>65 AND $DriveLetterCHAR=<90 $DriveLetter=CHR($DriveLetterCHAR)+":" $CLSID="{AAAAAAAA-0000-0000-0000-0000000000"+$DriveLetterCHAR+"}" IF EXIST($DriveLetter) SHELL'%ComSpec% /C NET USE $DriveLetter>d:\temp\NetUSe_$DriveLetterCHAR.dat 2>nul' $LinkName=$DriveLetter+" [Local]" $driveicon="8" if getfilesize("d:\temp\NetUSe_$DriveLetterCHAR.dat")>0 $LinkName=$DriveLetter+" [Network]" $driveicon="9" endif $Command="%SystemRoot%\Explorer.exe "+$DriveLetter $=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID") $=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\DefaultIcon") $=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\InProcServer32") $=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell") $=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell\Connect") $=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell\Connect\Command") $=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx") $=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx\PropertySheetHandlers") $=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx\PropertySheetHandlers\$CLSID") $=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx\ShellFolder") $=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID","",$LinkName,"REG_SZ") $=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\DefaultIcon","","%SystemRoot%\System32\Shell32.dll,$driveicon","REG_SZ") $=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\InProcServer32","","shell32.dll","REG_SZ") $=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\InProcServer32","ThreadingModel","Apartment","REG_SZ") $=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell\Connect\Command","",$Command,"REG_SZ") $=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellFolder","Attributes","0","REG_DWORD") $=addkey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\$CLSID") else $=deltree("HKEY_CLASSES_ROOT\CLSID\$CLSID") $=deltree("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\$CLSID") endif $DriveLetterCHAR=$DriveLetterCHAR+1 LOOP DEL"d:\temp\NetUSe_*.dat"
|
|
Top
|
|
|
|
#53682 - 2001-02-09 08:26 AM
Re: desk top icon for mapped drives
|
Anonymous
Anonymous
Unregistered
|
Hi all,Can anyone tell me what a "Name Space" is all about and maybe point me in a direction I could do some reading on them... A couple other comments which I think would enhance the results a little would be: 1. Can you detect whether a drive is local or network so icon could be changed appropriatley? 2. Can you retrieve the server name and share the drive is connected to so the Icon(?) can be named appropriately? Otherwise an excellent script.  Thanks, Terry. [This message has been edited by binghamt (edited 09 February 2001).] [This message has been edited by binghamt (edited 09 February 2001).]
|
|
Top
|
|
|
|
#53683 - 2001-02-09 02:18 PM
Re: desk top icon for mapped drives
|
Shawn
Administrator
   
Registered: 1999-08-13
Posts: 8611
|
Terry:Namespace... ermmm... ummm... A namespace is a COM object that can plug directly into (and communicate with) the Windows Explorer Shell (Desktop) ... Ummm... the best way to describe it would be to tell you what it's not - it's not a shortcut... when you right-click on a desktop shortcut - you get the standard stuff like open,scan sendto, etc... When you right click on a desktop namespace - explorer calls a special function in the namespace object to display it's own right-click menu items ... When you double-click on a shortcut - it runs whatever is defined in the target. When you double-click on a namespace object - explorer communicates with the object (through another special function) and helps it to display (in explorer fashion) whatever it is the namespace wants displayed... Hope this helps ? Shawn.
|
|
Top
|
|
|
|
#53685 - 2002-09-12 02:17 AM
Re: desk top icon for mapped drives
|
El Guappo
Fresh Scripter
Registered: 2002-05-14
Posts: 10
Loc: Vancouver, BC
|
Hey,
I've been trying to figure out why I get a network connection not found error when running this script. It happens when the Shell line is executed. All path statements are correct and the comspec variable has been set (Enviroment Variables). With this failure, it still can see the mapped drive, but any registry edits fail...
any ideas?
ElGuappo
|
|
Top
|
|
|
|
#53687 - 2002-09-12 03:24 PM
Re: desk top icon for mapped drives
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
lots of UDFs...
code:
for each $drive in split(DriveEnum(3)) $share=DriveProp($Drive) $sharepath=$share[2] $name=split($sharepath,"\")[3] $server=split($sharepath,"\")[2] $=WshShortCut("$desktop\$name on $server.lnk","$sharepath") next
|
|
Top
|
|
|
|
#53688 - 2002-09-12 06:15 PM
Re: desk top icon for mapped drives
|
El Guappo
Fresh Scripter
Registered: 2002-05-14
Posts: 10
Loc: Vancouver, BC
|
I have not changed the code too much since it does exactly what I want. This is the code
code:
CLS BREAK ON md temp $DriveLetterCHAR=67 WHILE $DriveLetterCHAR=>65 AND $DriveLetterCHAR=<90 $DriveLetter=CHR($DriveLetterCHAR)+":" IF EXIST($DriveLetter) SHELL '%COMSPEC% /c NET USE $DriveLetter>c:\temp\NetUSe_$DriveLetterCHAR.dat' CLS ENDIF $NULL=OPEN(1,"c:\temp\NetUSe_$DriveLetterCHAR.dat") $LINE1=READLINE(1) $NULL=CLOSE(1) IF INSTR($LINE1,"Local name")<>0 AT(02,02)"Drive : "$DriveLetter AT(04,02) $CLSID="{AAAAAAAA-0000-0000-0000-0000000000"+$DriveLetterCHAR+"}" $LinkName=$DriveLetter+"@Userid Home Drive" $Command="%SystemRoot%\Explorer.exe "+$DriveLetter $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\DefaultIcon") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\InProcServer32") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell\Connect") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell\Connect\Command") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx\PropertySheetHandlers") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx\PropertySheetHandlers\$CLSID") $NULL=addkey("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellEx\ShellFolder") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID","",$LinkName,"REG_SZ") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\DefaultIcon","","%SystemRoot%\System32\Shell32.dll,9","REG_SZ") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\InProcServer32","","shell32.dll","REG_SZ") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\InProcServer32","ThreadingModel","Apartment","REG_SZ") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\Shell\Connect\Command","",$Command,"REG_SZ") $NULL=writevalue("HKEY_CLASSES_ROOT\CLSID\$CLSID\ShellFolder","Attributes","0","REG_DWORD") $NULL=addkey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace\$CLSID") ENDIF $DriveLetterCHAR=$DriveLetterCHAR+1 LOOP DEL"c:\temp\NetUSe_*.dat"
It does everything I need...searches for mapped drives then edits the registry. PERFECT. But, running this on my W2K server, with W2K Prof w/s. Kixtart version 4.02 it fails to see the COMSPEC
EG
|
|
Top
|
|
|
|
Moderator: Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart
|
1 registered
(Allen)
and 675 anonymous users online.
|
|
|