CSCcmd - CMD
Overview
CSCcmd
is a client-side caching command-line tool used primarily on Windows operating systems for managing the Offline Files feature. The command provides various administrative functions allowing users to manipulate the offline file cache, such as viewing cache content, pinning new files, synchronizing files, and clearing the cache. This tool is especially useful in network environments where users need to manage files across remote and local storage effectively.
Syntax
CSCcmd [/ENABLE | /DISABLE | /ENUM[:n] | /MOVESHARE:src dst | /PIN:<path> [/RECURSE] | /UNPIN:<path> [/RECURSE] | /FILL | /MARKASGHOST:<path> | /UNMARKASGHOST:<path> | /SFPIN:<path> | /QUERYSPACE | /DELETE:<path> | /DB | /RESID]
Parameters:
path
: Specifies the path to the target files or directories.src
: Source path of the share.dst
: Destination path for the share.
Options/Flags
/ENABLE
: Enables Offline Files feature./DISABLE
: Disables Offline Files feature./ENUM[:n]
: Enumerates the topn
files in the offline cache./MOVESHARE:src dst
: Moves a share fromsrc
path todst
path./PIN:<path> [/RECURSE]
: Adds the specifiedpath
to the offline files cache. If/RECURSE
is specified, the operation includes all subdirectories./UNPIN:<path> [/RECURSE]
: Removes the specifiedpath
from the offline files cache. Recurssive operation is possible with/RECURSE
./FILL
: Forces a database fill operation./MARKASGHOST:<path>
: Marks the specifiedpath
file as ghosted in the cache./UNMARKASGHOST:<path>
: Unmarks the ghosted file at the specifiedpath
./SFPIN:<path>
: Pin shared folders for offline use without interaction./QUERYSPACE
: Queries the cache size and amount of space currently used./DELETE:<path>
: Deletes the specifiedpath
from the offline files cache./DB
: Provides database information of Offline Files./RESID
: Resets the CSC database and recreation occurs on next access.
Examples
- Enable Offline Files:
CSCcmd /ENABLE
- Pin a directory to cache:
CSCcmd /PIN:C:\Documents /RECURSE
- Check cache space usage:
CSCcmd /QUERYSPACE
- Move a shared network location:
CSCcmd /MOVESHARE:\\Server1\Docs \\Server2\BackupDocs
Common Issues
- Permission Issues: Users may face permission issues if not run with administrative privileges. Ensure you execute
CSCcmd
as an administrator. - Database Corruption: CSC database may get corrupted. Using
/RESID
can reset the database but this should be considered as a last resort due to data loss.
Integration
CSCcmd
can be integrated with batch scripts or other command-line tools to automate file management tasks. For instance, combining with robocopy
for robust file backup that includes offline cache management:
robocopy C:\Source D:\Backup /MIR
CSCcmd /PIN:D:\Backup /RECURSE
Related Commands
robocopy
: Robust file copy for Windows.net use
: Command to connect, remove, and configure connections to shared resources.
For more comprehensive guidance on managing offline files and related configurations, refer to the Official Windows Documentation.