Vbs Startscript führt batch datei nicht aus!
Hallo Leute!
Ich habe ein großes Problem. Ich bin ein totaler Anfänger in diesem bereich. Ich brauche ein Logonscript das überprüft ob ein spezieller Ordner vorhanden ist damit ich weiß ob ein Programm Installiert ist. Wenn dieser Ordner vorhanden ist soll nichts passieren und wenn der Ordner nicht vorhanden ist soll eine Batch-Datei aufgerufen werden die dann das fehlende Programm installiert. Die Batch-Datei funktioniert.
Das Script soll in einer Domäne als Startscript ablaufen.
Das habe ich mir mal zusammen gebastelt. Ich hoffe es kann mir jemand sagen was ich falsch mache.
Set fso = CreateObject("Scripting.FileSystemObject")
if fso.Folderexists("C:\Programme\Ordner") = true then
else
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.run "\\server\netlogon\batch.bat"
end if
Wenn ich das Script lokal aufrufe funktionirt es:
Set fso = CreateObject("Scripting.FileSystemObject")
if fso.Folderexists("C:\Programme\Ordner") = true then
else
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.run "C:\batch.bat"
end if
Danke im Voraus!
Lg
Das Script soll in einer Domäne als Startscript ablaufen.
Das habe ich mir mal zusammen gebastelt. Ich hoffe es kann mir jemand sagen was ich falsch mache.
Set fso = CreateObject("Scripting.FileSystemObject")
if fso.Folderexists("C:\Programme\Ordner") = true then
else
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.run "\\server\netlogon\batch.bat"
end if
Wenn ich das Script lokal aufrufe funktionirt es:
Set fso = CreateObject("Scripting.FileSystemObject")
if fso.Folderexists("C:\Programme\Ordner") = true then
else
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.run "C:\batch.bat"
end if
Danke im Voraus!
Lg
Please also mark the comments that contributed to the solution of the article
Content-Key: 120315
Url: https://administrator.de/contentid/120315
Printed on: April 25, 2024 at 11:04 o'clock
4 Comments
Latest comment