cdjphoenix Posted March 13, 2015 Share Posted March 13, 2015 (edited) Hello again everyone, I have another issue I was hoping someone could point out what I did wrong because I have no clue at this point. The part that is giving me trouble is just a FileCopy command but it says it cannot find the path. My only speculation is that the path is to long but I don't know. Here is what I have an it works. *Note: I had to do some sanitizing so it's not word for word but still should work. Also, I've been using msgbox to verify that the path being used is what I expect it to be. Case $msg = $CheckListSetup $ServerName = InputBox("Server Name", "What is the name of your server?") $Location = StringLeft($ServerName, 3) MsgBox(0,"","\\Server\IT\Operations\ITServer\Server_Team\SERVERS\Server_Builds\Windows Server Build Checklist.dotm \\Server\IT\Operations\ITServer\Server_Team\SERVERS\Group1\" & $ServerName & " Windows Server Build Checklist.dotm",$FC_CREATEPATH) if $Location = "aaa" Then FileCopy("\\Server\IT\Operations\ITServer\Server_Team\SERVERS\Server_Builds\Windows Server Build Checklist.dotm", "\\Server\IT\Operations\ITServer\Server_Team\SERVERS\Group1\" & $ServerName & " Windows Server Build Checklist.dotm",$FC_CREATEPATH) And when I go one folder deeper it stops working: Case $msg = $CheckListSetup $ServerName = InputBox("Server Name", "What is the name of your server?") $Location = StringLeft($ServerName, 3) MsgBox(0,"","\\Server\IT\Operations\ITServer\Server_Team\SERVERS\Server_Builds\Windows Server Build Checklist.dotm \\Server\IT\Operations\ITServer\Server_Team\SERVERS\Group1\" & $ServerName & "\" & $ServerName & " Windows Server Build Checklist.dotm",$FC_CREATEPATH) if $Location = "aaa" Then FileCopy("\\Server\IT\Operations\ITServer\Server_Team\SERVERS\Server_Builds\Windows Server Build Checklist.dotm", "\\Server\IT\Operations\ITServer\Server_Team\SERVERS\Group1\" & $ServerName & "\" & $ServerName & " Windows Server Build Checklist.dotm",$FC_CREATEPATH) Thank you for your time. Edited March 13, 2015 by cdjphoenix Link to comment Share on other sites More sharing options...
guinness Posted March 14, 2015 Share Posted March 14, 2015 Have you tried the beta version of AutoIt? Can you copy with the cp command? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
Radiance Posted March 14, 2015 Share Posted March 14, 2015 (edited) I've always had really weird problems noone could explain to me while using UNC-Paths with AutoIt. I'd suggest you try to map the path to a certain drive letter first, this usually solves all UNC mysteries. Edited March 14, 2015 by Radiance Link to comment Share on other sites More sharing options...
cdjphoenix Posted March 18, 2015 Author Share Posted March 18, 2015 Sorry for the delay in responding, go sick over the weekend. I will test both your theories and let you know what happens. I did notice something as I was playing around with it yesterday though. While it does not seem to be able to create the new folder it still seems like it will create the new file despite the error. Link to comment Share on other sites More sharing options...
iamtheky Posted March 18, 2015 Share Posted March 18, 2015 (edited) have you tried using filegetshortname? like: $path = "\\Server\IT\Operations\ITServer\Server_Team\SERVERS\Server_Builds" $file = "Windows Server Build Checklist.dotm" filecopy(filegetshortname(@ScriptDir & "\" & $file) , filegetshortname($path & "\" & $file)) Edited March 18, 2015 by boththose ,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-. |(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/ (_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_) | | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) ( | | | | |)| | \ / | | | | | |)| | `--. | |) \ | | `-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_| '-' '-' (__) (__) (_) (__) Link to comment Share on other sites More sharing options...
Solution cdjphoenix Posted March 18, 2015 Author Solution Share Posted March 18, 2015 I found the issue, it turned out to be a piece of code a little farther down. I couldn't tell because the path was so long it truncated the useful info. Link to comment Share on other sites More sharing options...
cdjphoenix Posted March 18, 2015 Author Share Posted March 18, 2015 I have note seen this filegetshortname yet so I will go play around with it. sounds useful. Link to comment Share on other sites More sharing options...
guinness Posted March 18, 2015 Share Posted March 18, 2015 I found the issue, it turned out to be a piece of code a little farther down. I couldn't tell because the path was so long it truncated the useful info.Aha! UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 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