Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Encrypted Files

Status
Not open for further replies.

Keyster86

IS-IT--Management
Jul 23, 2008
50
US
I am trying to utilize the "objFile.Copy" method.

However, I run into an error when the script reaches an encrypted file. I am copying files from my workstation to a server.

Any suggestions on how to copy over encrypted files?

P.S. By "encrypted", I mean clicking Properties > Advanced... > checking the box for "Encrypt contents to secure date".

V/r,

SPC Key
United States Army
 
As long as you performing the copy in the security context of the user who initially encrypted the files, it should be transparent to VBScript. If you cannot decrypt the files, then you will have to use a block level copy.

You might also try looking at WMI to detect encrypted files before performing the copy. [blue](SELECT Caption FROM Win32_Directory WHERE Drive = 'c:' and Path LIKE '%currentpath%' and Encrypted = 'true')[/blue]

If WMI detects such a file, you can then execute cipher.exe through the Shell object to decrypt it prior to the copy attempt. (BTW, the WMI check will slow the script down a lot. Hopefully the encrypted files are always in the same place.)

One last comment... In the grand scheme of things, you really don't want encrypted files on your server. You may have trouble backing up or recovering them, especially if you don't have the EFS recovery agent.

Good Luck!

PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top