dkuhn123
Goto Top

Synchronisation mehrerer Pcs übers Netzwerk

Hallo,
Ich arbeite gerade ein einem hta script mit welchem ich von einem Computer aus bestimmte Dateien auf die anderen Computer auf dem Netzwerk kopieren bzw löschen möchte.
Nun habe ich folgendes Problem.
Ich möchte nicht dass das Script nicht sofort schließt sondern wartet bis die Anweisung beendet ist.
Im Internet habe ich folgendes dazu gefunden.


'Verweis auf das Windows Script Host Object Model(WSH) ist nötig!
Dim objWSH_Shell As WshShell
Dim objWSH_Exec As WshExec

Set objWSH_Shell = New WshShell

'Anwendung starten (Kommandoparameter sind möglich)
Set objWSH_Exec = _
objWSH_Shell.Exec("Pfad/Name_der_Anwendung.exe")

With objWSH_Exec
'Auf Terminierung der Anwendung warten
Do While .Status = WSHRunning
DoEvents
Loop

'Auswertung des Rückgabeparameters
Select Case .ExitCode
'Die ExitCodes sind von der gestarteten
'Anwendung abhängig!
End Select
End With


Und ich versuche schon das den Ganzen Tag in meinen Code einzufügen doch es will auf Teufel komm raus nicht funktionieren egal wie ich es einfüge.
Könntet ihr mir vllt sagen wie ich das anstelle?
Hier mal der VBS Teil.


<script language="VBScript">
MoveTo 250,100
ResizeTo 310,425

Public PcNummer
Sub Operation2(PC)
If PC = 10 Then
PcNummer = PC
else
PcNummer = "0" & PC
End If
End Sub
Sub Synchro()

objWSH_Shell.Exec("del \\Training" & PcNummer & "\Training" & PcNummer & "$\Works /Q/F/S")
objWSH_Shell.Exec("del \\Training" & PcNummer & "\Training" & PcNummer & "$\DXF /Q/F/S")
objWSH_Shell.Exec("del \\Training" & PcNummer & "\Training" & PcNummer & "$\database /Q/F/S")
objWSH_Shell.Exec("del \\Training" & PcNummer & "\Training" & PcNummer & "$\Contour /Q/F/S")
objWSH_Shell.Exec("del \\Training" & PcNummer & "\Output" & PcNummer & "$ /Q/F/S")
objWSH_Shell.Exec("del \\Training" & PcNummer & "\Profi" & PcNummer & "$ /Q/F/S")
objWSH_Shell.Exec("del \\Training" & PcNummer & "\Training" & PcNummer & "$\registry /Q/F/S")

objWSH_Shell.Exec ("xcopy C:\Synchronisation\database \\Training" & PcNummer & "\Training" & PcNummer & "$\database /S/Y")
objWSH_Shell.Exec ("xcopy C:\Synchronisation\Contour \\Training" & PcNummer & "\Training" & PcNummer & "$\Contour /S/Y")
objWSH_Shell.Exec ("xcopy C:\Synchronisation\Output \\Training" & PcNummer & "\Output" & PcNummer & "$ /S/Y")
objWSH_Shell.Exec ("xcopy C:\Synchronisation\ProfDXF \\Training" & PcNummer & "\Profi" & PcNummer & "$ /S/Y")
objWSH_Shell.Exec ("xcopy C:\Synchronisation\registry \\Training" & PcNummer & "\Training" & PcNummer & "$\registry /S/Y")

End Sub
</script>


Ich wäre euch sehr dankbar.
Lg DKuhn

Content-Key: 131656

Url: https://administrator.de/contentid/131656

Printed on: April 25, 2024 at 02:04 o'clock