mbiwpeoyc Posted April 16, 2005 Share Posted April 16, 2005 (edited) I'm trying to get this file to sync up our outlook macro's here in my office except for one person (the guy who makes em). Now for some reason it won't copy for anyone else either, and I don't get it. No errors, no nothing, it just never copies. The files and directories exist on both ends on all the systems and none of them get errors... Any help is greatly appreciatted Here's what I have so far. Assign ("noup", "login") $path = "c:\documents and settings\%username%\Application Data\Microsoft\Outlook\" $remote = "p:\_transer\zz\vba\" $file = "VbaProject.OTM" $drive = FileExists("p:\") $ver = FileGetTime($path & $file, 0, 1) $rver = FileGetTime($remote & $file, 0, 1) Do $drive = FileExists("p:\");Check for p drive at bootup Sleep(1000) Until $drive = "1" If @Username = $noup Then Exit EndIf If Not FileExists("c:\documents and settings\%username%\Application Data\Microsoft\Outlook\VbaProject.OTM") Then FileCopy ("p:\_transfer\zz\vba\VbaProject.OTM", "c:\documents and settings\%username%\Application Data\Microsoft\Outlook\") Exit ElseIf FileExists("c:\documents and settings\%username%\Application Data\Microsoft\Outlook\VbaProject.OTM") Then FileCopy ("p:\_transfer\zz\vba\VbaProject.OTM", "c:\documents and settings\%username%\Application Data\Microsoft\Outlook\", 1) Exit EndIf I realize I've got variables defined with the paths, I've tried with and without them with the same results. Edited April 16, 2005 by mbiwpeoyc Link to comment Share on other sites More sharing options...
PerryRaptor Posted April 16, 2005 Share Posted April 16, 2005 I think you need to replace %username% with @UserName Link to comment Share on other sites More sharing options...
mbiwpeoyc Posted April 16, 2005 Author Share Posted April 16, 2005 I think you need to replace %username% with @UserName<{POST_SNAPBACK}>So...'c:\Documents and Settings' & @UserName & '\Microsoft\Outlook\'? Link to comment Share on other sites More sharing options...
Developers Jos Posted April 16, 2005 Developers Share Posted April 16, 2005 I think you need to replace %username% with @UserName<{POST_SNAPBACK}>or use OPT("ExpandEnvStrings",1).... SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
PerryRaptor Posted April 16, 2005 Share Posted April 16, 2005 Need to add a "\" after ...Documents and Settings 'c:\Documents and Settings\' & @UserName & '\Microsoft\Outlook\' Link to comment Share on other sites More sharing options...
mbiwpeoyc Posted April 16, 2005 Author Share Posted April 16, 2005 Need to add a "\" after ...Documents and Settings'c:\Documents and Settings\' & @UserName & '\Microsoft\Outlook\'<{POST_SNAPBACK}>Thanks guys, looks like that did it. Had to go from using explicit paths in the FileExists part to using the variables and implementing the above change there, but it worked. 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