Sam1814 Posted October 16, 2014 Share Posted October 16, 2014 I have a script which will attach and send files as part of an email. It works as intended except that when a file is located in the "UsersPublicPublic Documents" folder the attachment fails. This is the pertinent part of the code: $AttachFiles = "C:UsersPublicPublic DocumentsAccount ManagerAccount.dat" Error Code:1 Description:0 is the error message. I realize that C:UsersPublic" has a system variable of %PUBLIC%, and have tried using that as part of the filepath. I have also added an underscore for the folder "Account_Manager". This is a Windows 7 environment with a Standard User account running the AutoIt executable. The Account.dat file is accessible by the Standard User from either location and does not require elevation to Administrator for read/write. The name of the Standard User account [logged on as] is Office. What is the proper path filename to use in this scenario? Thanks in advance. Link to comment Share on other sites More sharing options...
Danp2 Posted October 16, 2014 Share Posted October 16, 2014 Have you tried this?: $AttachFiles = FileGetShortName("C:\Users\Public\Public Documents\Account Manager\Account.dat") Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Valuater Posted October 16, 2014 Share Posted October 16, 2014 (edited) Just an idea... If the Standard account is the problem $AttachFiles = "C:\Users\Public\Public Documents\Account Manager\Account.dat" $CopyFile = "C:\Temp\TxtFiles\" FileCopy( $AttachFiles, $CopyFile, 9) ; 1 = overwrite existing files + 8 to create the directory ; Use "C:\Temp\TxtFiles\Account.dat" to attach Edited October 16, 2014 by Valuater Link to comment Share on other sites More sharing options...
Sam1814 Posted October 16, 2014 Author Share Posted October 16, 2014 Tried that as well. DUH!!! Foolish Me! Apparently, the actual path is "C:UsersPublicDOCUMENTS". Despite the fact that the Windows Explorer displays the path as being "C:UsersPublicPublic Documents..." in the command prompt window the folder is named "Documents" rather than "Public Documents". Problem solved. Thanks anyway. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now