Posted by dUkk on Fri 19 Jun 18:24
report abuse | download | new post
- // setscache-2k8.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- int _tmain(int argc, _TCHAR* argv[])
- {
- SHARE_INFO_1005 p = {0};
- NET_API_STATUS res;
- DWORD parm_err = 0;
- if(argc<4)
- wprintf(_T("Usage: SetSCache \\\\server share mode\n Where mode is:\n 0 - None\n 1 - Programs\n 2 - Documents\n 3 - Manual"));
- else
- {
- switch(_ttoi(argv[3]))
- {
- case 3: p.shi1005_flags=CSC_CACHE_MANUAL_REINT; break;
- case 2: p.shi1005_flags=CSC_CACHE_AUTO_REINT; break;
- case 1: p.shi1005_flags=CSC_CACHE_VDO; break;
- case 0:
- default: p.shi1005_flags=CSC_CACHE_NONE; break;
- }
- res=NetShareSetInfo(argv[1], argv[2], 1005, (LPBYTE)&p, &parm_err);
- if(res==0)
- wprintf(_T("Cache set.\n"));
- else
- wprintf(_T("Error: %u\t parmerr=%u\n"), res, parm_err);
- }
- return 0;
- }
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.