Vicks Posted July 1, 2006 Share Posted July 1, 2006 this part of my script isn't working #include <File.au3> DirGetSize(@ProgramFilesDir & "/don't delete") If @error = 1 Then DirCreate(@ProgramFilesDir & "/don't delete") EndIf $path = @DesktopDir & "Folder/object" $path2 = @ProgramFilesDir & "/don't delete" FileInstall($path, $path2) [s]Autoit[/s] Link to comment Share on other sites More sharing options...
Valuater Posted July 1, 2006 Share Posted July 1, 2006 1 i dont think you can use this ' in a folder name 2 fileinstall is to include that file in the script maybe filemove?? #include <File.au3> $path = @DesktopDir & "\Folder\test.txt" $path2 = @ProgramFilesDir & "\dont delete\" DirGetSize($path2) If @error = 1 Then DirCreate($path2) EndIf FileMove($path, $path2) *** tested ok 8) Link to comment Share on other sites More sharing options...
Vicks Posted July 1, 2006 Author Share Posted July 1, 2006 1 i dont think you can use this ' in a folder name 2 fileinstall is to include that file in the script maybe filemove?? #include <File.au3> $path = @DesktopDir & "\Folder\test.txt" $path2 = @ProgramFilesDir & "\dont delete\" DirGetSize($path2) If @error = 1 Then DirCreate($path2) EndIf FileMove($path, $path2) *** tested ok 8)whoops i just notice that thanks so much [s]Autoit[/s] Link to comment Share on other sites More sharing options...
PsaltyDS Posted July 1, 2006 Share Posted July 1, 2006 #include <File.au3> $path = @DesktopDir & "\Folder\test.txt" $path2 = @ProgramFilesDir & "\dont delete\" DirGetSize($path2) If @error = 1 Then DirCreate($path2) EndIf FileMove($path, $path2) whoops i just notice that thanks so much Just out of curiosity (or noseyness, if you like)... You seem to be using DirGetSize as a test for the existence of the folder? FileExists() will test for files and directories. If there might be a file of the given name, and you want to be sure you are testing for a directory, just add the trailing backslash (which I see you've added to $path2 already). A major difference between FileExists() and DirGetSize() is the binary return that makes it much tighter and quicker to assess the results: $path = @DesktopDir & "\Folder\test.txt" $path2 = @ProgramFilesDir & "\dont delete\" If Not FileExists($path2) DirCreate($path2) FileMove($path, $path2) Cheers! Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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