Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; -- Trying to copy a background across many devices, the path has two spaces that I cannot change --
- ; -- I can copy using FileCopyDir without issue, but that copies too many files.
- ; -- For some reason FileCopy, *.filetype won't work. It's giving "file not found" error, i think on source.
- ; -- I tried creating the directory in advance, but even when path directory exists I get same error!
- ; -- Here's what I tried:
- ; This doesn't work at all, error from dll call says "2" which is "file not found"
- FileCopy, D:\Arcade\Tools\JoyToKey_en 5.8.1 (CLM)\*.cfg, %A_WorkingDir%\SettingsSaver\Arcade\Tools\JoyToKey_en 5.8.1 (CLM)
- If ErrorLevel
- {
- ; MsgBox, Command = FileCopy, `n D:\Arcade\Tools\JoyToKey_en 5.8.1 (CLM)\*.cfg, `n %A_ScriptDir%\SettingsSaver\Arcade\Tools\JoyToKey_en 5.8.1 (CLM)\*.cfg
- DllCall("CopyFile", "Str", "SourcePathAndFile", "Str", "DestPathAndFile", Int, 0) ;Last parameter is over-write flag
- MsgBox %A_LastError%
- }
- ; Tried again as above but this time one specific file, same error
- FileCopy, D:\Arcade\Tools\JoyToKey_en 5.8.1 (CLM)\JoyToKey.ini, %A_ScriptDir%\SettingsSaver\Arcade\Tools\JoyToKey_en 5.8.1 (CLM)\JoyToKey.ini
- ; set variable in case double spaces or parenthesis are issue in directory
- BadDir = Arcade\Tools\JoyToKey_en 5.8.1 (CLM)
- ; Tried using the variable I set in previous line, same error
- FileCopy, D:\%BadDir%\AppLink.dat, %A_ScriptDir%\SettingsSaver\%BadDir%\AppLink.dat
- MsgBox D:\%BadDir%\AppLink.dat, %A_ScriptDir%\SettingsSaver\%BadDir%\AppLink.dat
- If ErrorLevel
- {
- ; MsgBox, Command = FileCopy, `n D:\Arcade\Tools\JoyToKey_en 5.8.1 (CLM)\*.cfg, `n %A_ScriptDir%\SettingsSaver\Arcade\Tools\JoyToKey_en 5.8.1 (CLM)\*.cfg
- DllCall("CopyFile", "Str", "SourcePathAndFile", "Str", "DestPathAndFile", Int, 0) ;Last parameter is over-write flag
- MsgBox %A_LastError%
- }
- MsgBox, Saved Controller Configurations!
- ; I try from dos instead. Error said "The system cannot find the path specified. 0 file(s) copied"
- ; I think it's new path not source path. I think it's finding files in source, but won't create directory.
- Runwait, %comspec% /k copy "D:\Arcade\Tools\JoyToKey_en 5.8.1 (CLM)\*.cfg" "%A_WorkingDir%\SettingsSaver\Arcade\Tools\JoyToKey_en 5.8.1 (CLM)\*.cfg"
- ; Tried using variable too. Nope.
- Runwait, %comspec% /k copy "D:\%BadDir%\AppLink.dat" "%A_ScriptDir%\SettingsSaver\%BadDir%\AppLink.dat"
- ; On second occurance of variable, i got a weird missing variable. Does variable reset on error?
- ; The next line below caused this error: http://imgur.com/a/FtE4U
- Runwait, %comspec% /k copy "D:\%BadDir%\AppLink.dat" "%A_ScriptDir%\SettingsSaver\%BadDir%\AppLink.dat"
- ; Tried copying to a plain directory "j2k" and then renaming, still couldn't find path.
- Runwait, %comspec% /c copy copy "D:\Arcade\Tools\JoyToKey_en 5.8.1 (CLM)\*.cfg" "c:\users\theba\desktop\new folder\j2k\*.cfg" && ren j2k "JoyToKey_en 5.8.1 (CLM)"
- ; But this works, no issue. The FileCopyDir. Why can it find directory but not files????????
- FileCopyDir, D:\Arcade\Tools\JoyToKey_en 5.8.1 (CLM), %A_ScriptDir%\SettingsSaver\Arcade\Tools\JoyToKey_en
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement