मेरे पास पावरशेल स्क्रिप्ट है जो लॉगिन पर नेटवर्क स्थानों पर शॉर्टकट बनाती है। दुर्भाग्यवश, यह पुराने लो-रेज आइकन का उपयोग कर रहा है। यह किसी भी माध्यम से एक बड़ा सौदा नहीं है, लेकिन मैं विंडोज के बाद के संस्करणों में अद्यतन आइकन का उपयोग करना चाहता हूं।सही "नेटवर्क स्थान" आइकन कैसे चुनें?
# Create the shortcut file
$shortcut = (New-Object -ComObject WScript.Shell).Createshortcut("$shortcutFolder\target.lnk")
$shortcut.TargetPath = $targetPath
if (
$shortcut.IconLocation = "%SystemRoot%\system32\SHELL32.DLL, 275"
$shortcut.Description = $targetPath
$shortcut.WorkingDirectory = $targetPath
$shortcut.Save()
# Set attributes on the files & folders
$desktopIni | Set-ItemProperty -Name Attributes -Value ([IO.FileAttributes]::System -bxor [IO.FileAttributes]::Hidden)
$shortcutFolder | Set-ItemProperty -Name Attributes -Value ([IO.FileAttributes]::ReadOnly)
आप देख सकते हैं, यह वर्तमान में चिह्न # 275 shell32.dll पुस्तकालय में उपयोग कर रहा है:
यहाँ समारोह है कि शॉर्टकट बनाता है के संबंधित भाग है। विंडोज 7 में, imageres.dll में "उचित" आइकन आइकन # 143 होगा। एक्सप्लोरर नेमस्पेस में किसी विशेष फ़ोल्डर का संदर्भ प्राप्त करने जैसे ओएस से आइकन विवरण प्राप्त करने का कोई तरीका है?
चिह्न # 143 imageres.dll में के लिए ठीक नहीं है आप ? – JPBlanc
यदि स्क्रिप्ट Windows XP मशीन पर चलती है, तो यह गलत आइकन खींचने जा रहा है, क्योंकि इंडेक्स बिल्ड के बीच भिन्न होता है। – bshacklett
क्यों लिंक बनाने से पहले ऑपरेटिव सिस्टम का नाम परीक्षण करें और नंबर को पसंद में बदलें? –