36539
Nov 24, 2008, updated at Nov 25, 2008 (UTC)
7041
4
0
VBS-Script Ändern auf automatische systemroot-Erkennung
Hallo
ich hatte mal eine *.VBS gefunden mit dem ich für meine Batch bei Bedarf eine Verknüpfung auf dem Desktop erstellen kann.
Könnt ich mir den Code so ändern das in der Zeile 8 und 13 ("link1.TargetPath = -...) das System-LW automatisch vom *.vbs eingestellt wird.
Danke
onegase59
ich hatte mal eine *.VBS gefunden mit dem ich für meine Batch bei Bedarf eine Verknüpfung auf dem Desktop erstellen kann.
set wshshell = CreateObject("WScript.Shell")
'Ort des Windowsdesktops
'desktopdir = "System-LW\winnt\profiles\USERID\desktop"
desktopdir = wshshell.SpecialFolders(0)
neuerlink = desktopdir & "\PC Neustart.lnk"
set link = wshshell.Createshortcut(neuerlink)
link.TargetPath = "C:\WIN-Scripte\PC-Shutdown-Reboot\PC Neustart.exe"
link.Save
neuerlink1 = desktopdir & "\PC Ausschalten.lnk"
set link1 = wshshell.Createshortcut(neuerlink1)
link1.TargetPath = "C:\WIN-Scripte\PC-Shutdown-Reboot\PC Ausschalten.exe"
link1.Save
'MsgBox ("Verknüpfungen zu "PC Neustart.exe" und "PC Ausschalten.exe" wurden auf dem Desktop angelegt!")
Könnt ich mir den Code so ändern das in der Zeile 8 und 13 ("link1.TargetPath = -...) das System-LW automatisch vom *.vbs eingestellt wird.
Danke
onegase59
Please also mark the comments that contributed to the solution of the article
Content-Key: 102579
Url: https://administrator.de/contentid/102579
Printed on: April 23, 2024 at 19:04 o'clock
4 Comments
Latest comment
etwa so:
'Wsh Shell Objekt
set wshshell = CreateObject("WScript.Shell")
'Ort des Windowsdesktops
desktopdir = wshshell.SpecialFolders(0)
'Laufwerksbuchstabe
systemDrive = wshshell.ExpandEnvironmentStrings("%SYSTEMDRIVE%")
neuerlink = desktopdir & "\PC Neustart.lnk"
set link = wshshell.Createshortcut(neuerlink)
link.TargetPath = systemDrive & "\WIN-Scripte\PC-Shutdown-Reboot\PC Neustart.exe"
link.Save
neuerlink1 = desktopdir & "\PC Ausschalten.lnk"
set link1 = wshshell.Createshortcut(neuerlink1)
link1.TargetPath = systemDrive & "\WIN-Scripte\PC-Shutdown-Reboot\PC Ausschalten.exe"
link1.Save