The following code was found at "http://www.eriugena.org/code/sendto/" and used in a Wincows XP Pro backup batch file, and it (sendtoEFS.exe) worked great, except for an unwanted pause at the end caused by a messagebox. The website made available the GPL sendtoEFS.cpp source code, so I thought, even though my C++ knowledge was limited, that I would simply delete said messagebox from .cpp and recompile with (downloaded) Quincy 2005. However, the .cpp code wouldn't compile, and returned several errors of type "variable was not declared in this scope" (for OpenEncryptedFileRaw, CloseEncryptedFileRaw, WriteEncryptedFileRaw, and ReadEncryptedFileRaw variables). I've spent many hours studying and trying to figure this out, but don't know why sendtoEFS.exe runs fine, but sendtoEFS.cpp won't compile. Help would be appreciated; thank you.
[/code]
/*
Author: Kevin Connolly http://www.eriugena.org/
(sendtoEFS.cpp) released under GPL
*/
if( (nRaw) &&(nRaw==nFiles) ) {
printf("All files are EFSRAW\n");
lstrcpyn(szDrive, argv[1], 4);
GetVolumeInformation( szDrive, NULL, 0, NULL, NULL, &dwFileSystemFlags, NULL, 0);
if( !(dwFileSystemFlags & FILE_SUPPORTS_ENCRYPTION)) {
printf("Filesystem does not support encryption on %s\n", szDrive);
MessageBox(NULL, "Filesystem does not support encryption. Copy file to another drive.", NULL, NULL);
exit(1);
}
for(i=1;i<argc;i++) {
j = lstrlen(argv[i]) - 6; /* ignore 7 chars ".efsraw" */
lstrcpyn(szNewPath, argv[i], j);
rc = CopyFileFromRaw(argv[i], szNewPath);
printf("%u %s\n", rc, argv[i]);
}
}
if( (nRaw) &&(nRaw<nFiles) ) {
MessageBox(NULL, "Please select only all EFS or all EFSRAW files and not a mix", NULL, NULL);
}