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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Remove file encryption using VBA 1

Status
Not open for further replies.

Webkins

Programmer
Dec 11, 2008
118
0
0
US
I have a networked access 2003 program which copies user selected files from a users computer to a server computer. The text of these file names on the user computer are in green letters which I assume means that they are encrypted. My vba code can copy only the file names which are in black letters, which I also assume means that they are un-encrypted. Trying to copy a green filename file locks up the computer and stops responding. Copying a black filename file works perfectly every time. I am using copyfile and have tried xcopy and cipher.My question is this: Is there a way, program or procedure for VBA to remove the file encryption from the users file before copying it to the server computer for storage ? I have been trying to use the Windows XP Pro version of the Cipher command and switches without success. I have been searching this website but I am finding no results. I wonder if this issue or topic has ever come up before. Any other ideas or suggestions ? I do love a challenge and this is a good one ! Thanks so much.
 
How are you attempting the copy? Are you using Windows Shell commands, or are you using the FileSystemObject in VBA?

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Here is the solution I have found and works very well...

To unencrypt the file: dosCmd = "cipher /a /d /s:" & attachment_1
To wait for the unencrypt before proceeding: ReturnCode = Sh.Run(dosCmd, 1, True, vbHide)

Hope this helps someone !
 
Glad it worked out, and thanks for sharing your solution. That's something good to remember for any DOS commands. Pretty nifty. [thumbsup2]

"But thanks be to God, which giveth us the victory through our Lord Jesus Christ." 1 Corinthians 15:57
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top