Sign in to follow this  
Followers 0
Vicks

help

4 posts in this topic




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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
Share on other sites

#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)... :wacko:

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! :D


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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0