forked from MicksITBlogs/PowerShell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnableDisableOfflineFiles.vbs
36 lines (28 loc) · 1.24 KB
/
EnableDisableOfflineFiles.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
'*******************************************************************************
' Program: EnableDisableOfflineFiles.vbs
' Author: Mick Pletcher
' Date: 25 June 2012
' Modified:
'
' Description: This will enable or disable the Offline File Cache
' 1) Set Offline File Cache
'*******************************************************************************
Option Explicit
REM Set Offline File Cache
SetOfflineFileCache()
'*******************************************************************************
'*******************************************************************************
Sub SetOfflineFileCache()
REM Define Local Constants
CONST Disable = "False"
CONST Enable = "True"
REM Define Local Objects
DIM oShell : SET oShell = CreateObject("Wscript.Shell")
REM Define Local Variables
' Change the variable at the end of the Install Variable to either Enable or Disable
DIM Install : Install = "wmic path win32_offlinefilescache call enable" & Chr(32) & Disable
oShell.Run Install, 1, True
REM Cleanup Local Variables
Set Install = Nothing
Set oShell = Nothing
End Sub