我想执行cmd命令,改变文件/文件夹权限对于ntfs文件系统才有效我想判断当前的文件系统是fat/fat32还是ntfs应该怎么做啊??????如果是ntfs就执行下面的下面的cmd命令要在当前程序运行目录下执行才能成功所以我想是否需要先执行一个cd命令?cd C:\Documents and Settings\Administrator\桌面\Soft\InstallUpdate\Debug>
Cacls web /t /e /c /g ASPNET:f这样可以吗?cmd命令下换行怎么写的啊?是否还有更简单的方法?如果先WinExec("cd C:\Documents and Settings\Administrator\桌面\Soft\InstallUpdate\Debug>")
在WinExec("Cacls web /t /e /c /g ASPNET:f")
这样可以吗?
Cacls web /t /e /c /g ASPNET:f这样可以吗?cmd命令下换行怎么写的啊?是否还有更简单的方法?如果先WinExec("cd C:\Documents and Settings\Administrator\桌面\Soft\InstallUpdate\Debug>")
在WinExec("Cacls web /t /e /c /g ASPNET:f")
这样可以吗?
BOOL GetVolumeInformation(
LPCTSTR lpRootPathName,
LPTSTR lpVolumeNameBuffer,
DWORD nVolumeNameSize,
LPDWORD lpVolumeSerialNumber,
LPDWORD lpMaximumComponentLength,
LPDWORD lpFileSystemFlags,
LPTSTR lpFileSystemNameBuffer,
DWORD nFileSystemNameSize
);lpFileSystemNameBuffer
[out] Pointer to a buffer that receives the name of the file system (such as the FAT file system or the NTFS file system).
nFileSystemNameSize
[in] Length of the file system name buffer, in TCHARs. This parameter is ignored if the file system name buffer is not supplied.
在WinExec("Cacls web /t /e /c /g ASPNET:f")
这样可以吗?------------------试过了,这样无法成功
DentistryDoctor(不在无聊中无奈,就在沉默中变态) ( ) 信誉:194 Blog
-------------------有详细的例子吗?我是新手
弄成上面这个样子运行也不成功帮帮忙啊
如果可能,请尽可能用CreateProcess来替换。WinExec("cd \"C:\\Documents and Settings\\Administrator\\桌面\\Soft\\InstallUpdate\\Debug\"", ...);WinExec("Cacls web /t /e /c /g ASPNET:f", ...);
CString strCmdStr = "Cacls ";
strCmdStr += strFileName ;
strCmdStr += " /t /e /c /g ASPNET:";
strCmdStr += strRight; CString strPath;
CUitility util;
util.GetCurrentDir(strPath);
CString cdCmdStr="cd ";
cdCmdStr += strPath; WinExec(cdCmdStr,SW_HIDE);
WinExec(strCmdStr,SW_HIDE);这样不行!