Reputation: 3472
Is it possible to programmatically encrypt files (with EFS) using vbscript. Are there any EFS API's that can be used with c# on windows 7?
Upvotes: 1
Views: 1587
Reputation: 65682
I translated your answer to C#:
WshShell sh1 = new WshShell();
var retval = sh1.Run("CIPHER /E /S:" & strDir, 0, True);
Upvotes: 1
Reputation: 3472
No answers yet !! meanwhile one option was to use the folowing script
Dim strDir, objShell, FSO, WshShell
strDir = "D:\TestFolder"
Set objShell = CreateObject("Shell.Application")
Set FSO = CreateObject("Scripting.FileSystemObject")
Set WshShell = WScript.CreateObject("WScript.Shell")
retval = WshShell.Run("CIPHER /E /S:" & strDir, 0, True)
MsgBox("Success")
Upvotes: 0