'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' Script : Verschiebt eine Datei ' ' File : VerschiebeDatei.vbs ' ' Date : 2006-11-16 - Last modified: 2006-11-16 ' ' ' ' Michael Puff - http://www.michael-puff.de ' ' ' ' Übung "Übergang vom Modell zum lauffähigen Programm ' ' Erweiterete Version mit Fehlerbehandlung ' ' ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Set fso = CreateObject("Scripting.FileSystemObject") strFile = "test.txt" strSrcPath = "h:\" strDestPath = "h:\foobar\" if fso.FileExists(strSrcPath + strFile) then Set f = fso.getFile(strSrcPath + strFile) if fso.FolderExists(strDestPath) then f.move strDestPath + strFile WScript.Echo "Datei " + strFile + " nach " + strDestPath + " verschoben" else WScript.Echo "Zielordner " + strDestPath + " existiert nicht" end if else WScript.Echo "Datei " + strSrcPath + strFile + " existiert nicht" end if