-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.vbs
41 lines (29 loc) · 1.16 KB
/
script.vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Set objShell = WScript.CreateObject("WScript.Shell")
Do While 1=1
' PART FOR TAKING SCREENSHOT
' "-i 0" is for Windows XP
' "-i 1" is for Windows 7, but somewhere works it without number
cmds = objShell.Run ("c:\PSTools\psexec.exe -u DOMAIN\account-name -p password -i 0 \\computer-name c:\windows\nircmd.exe loop 1 10 savescreenshot \\placeTOsave\scr~$currdate.MM_dd_yyyy$-~$currtime.HH_mm_ss$.png /SILENT", 0)
'waiting loop for 5 minutes
WScript.Sleep 300000
' PART FOR REMOVING OLD SCREENSHOTS
' ################################################################
' # cleanup-folder.vbs
' #
' # Removes all files older than 1 week
' # Authored by Spencer Kuziw (s.kuziw-at-epic.ca)
' # Based on code by YellowShoe
' # Version 1.0 - Sept 23 2008
' ################################################################
Dim fso, f, f1, fc, strComments, strScanDir
' will remove 7 days old screenshots
strDays = 7
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.GetFolder("c:\placeTOsave")
Set fc = f.Files
For Each f1 in fc
If DateDiff("d", f1.DateCreated, Date) > strDays Then
fso.DeleteFile(f1)
End If
Next
Loop