Behver hjlp med att skapa ett .bat skript eller liknande som automatiskt kollar ifall ett text dokument har skapats i mappen, och om det sker s ska den automatiskt spela upp en ljud (.wav) fil.
Hittills bara hittat ett sett att spela upp ljudet:
Kod:
mplay32 /play /close c:\windows\media\chimes.wav
Ngon som vet?
Hitta ven detta som ska vara ett skript fr att kolla ifall en fil skapas i mappen, men frstr vldigt lite av det:
Kod:
'Create needed variables
Dim SOURCE, TARGET, waitTime, objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
'=============================================
'========== USER DEFINED VARIABLES ===========
'=============================================
SOURCE = "x:\Test1"
TARGET = "c:\Test1"
SECONDS = 5 'Time to wait between checking SOURCE
'=============================================
'=============================================
'Verify if source folder exists
If Not (objFSO.FolderExists(SOURCE)) Then
MsgBox "Source Folder Missing"
Else
'Create target directory if does not exist
If Not (objFSO.FolderExists(TARGET)) Then
objFSO.CreateFolder(TARGET)
End If
'Run the moveFiles function
moveFiles
End If
'=============================================
Sub moveFiles
'=============================================
'Copy files from SOURCE to TARGET
objFSO.CopyFolder SOURCE, TARGET
'Delete the TARGET folder (and contents)
objFSO.DeleteFolder SOURCE
'Recreate TARGET folder
objFSO.CreateFolder(SOURCE)
'Wait time before checking SOURCE again
WScript.Sleep SECONDS * 1000
'Recall the moveFiles function
moveFiles
'=============================================
End Sub 'replicateFolders
'=============================================