#204882 - 2012-04-21 10:48 PM
Re: postprep inbuilt to the forums
[Re: Lonkero]
|
NTDOC
Administrator
   
Registered: 2000-07-28
Posts: 11634
Loc: Space
|
[postprep]
Function AddToMyNetworkPlaces($Name,$Location,Optional $Comment)
Dim $Nethood,$Shell,$S,$D,$T
$AddToMyNetworkPlaces=1
If Exist($Location)
$Nethood=ReadValue('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders','NetHood')
If GetFileAttr($Nethood+'\'+$Name) & 16
; 'Link exists already. Exit the function.
Exit 80
EndIf
MD $Nethood+'\'+$Name
$D=$Nethood+'\'+$Name+'\'+'Desktop.ini'
$T=$Nethood+'\'+$Name+'\'+'target.lnk'
$S = SetFileAttr($Nethood+'\'+$Name,1)
$S = WriteProfileString ($D,'.ShellClassInfo','CLSID2','{0AFACED1-E828-11D1-9187-B532F1E9575D}')
$S = WriteProfileString ($D,'.ShellClassInfo','FLAGS','2')
$S = SetFileAttr($D,6)
$Shell = CreateObject('wscript.shell')
If @ERROR Exit @ERROR EndIf
$S = $Shell.CreateShortcut($T)
$S.TargetPath = $Location
$S.WorkingDirectory = $Location
If $Comment
$S.Description = $Comment
EndIf
$S.Save
If @ERROR Exit @ERROR Else $AddToMyNetworkPlaces=0 EndIf
Else
Exit 3
EndIf
EndFunction
|
|
Top
|
|
|
|
#204956 - 2012-04-25 11:49 AM
Re: postprep inbuilt to the forums
[Re: It_took_my_meds]
|
BradV
Seasoned Scripter
  
Registered: 2006-08-16
Posts: 687
Loc: Maryland, USA
|
I agree it is excellent work, but disagree on making it the default. To me the colorization makes the code distracting and difficult to read. I can see using it as a tool to quickly point out some things, but I personally find it makes new code more difficult to read through. To each his own.
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 702 anonymous users online.
|
|
|