garyf Posted February 10, 2015 Posted February 10, 2015 Hi Newbie here. I'm using FileChangeDir($p) to change the current dir to the path in var $p. It does not work. Works if I code FileChangeDir("d:AutoITdata"). Any ideas would be greatly appreciated.
JohnOne Posted February 10, 2015 Posted February 10, 2015 "It does not work" is never enough. Please elaborate and post your whole runnable code. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
garyf Posted February 10, 2015 Author Posted February 10, 2015 Sorry, when I wrote it doesn't work, I meant that the original content of the working directory was unchanged. It changed only when I used a explicit string in quotes .
JohnOne Posted February 10, 2015 Posted February 10, 2015 Can you show an example of exactly how you get the path variable into $p AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
garyf Posted February 11, 2015 Author Posted February 11, 2015 Now I'm getting more weird stuff #include "MsgBoxConstants.au3" ; set up working dir FileChangeDir("D:A-Screenshots") msgbox(0,"testing 1","working dir: ",@WorkingDir) ;<=== this displays a blank for the working dir $var = "d:Games" FileChangeDir($var) msgbox(0,"testing 2","working dir: ",@WorkingDir) ;<=== this displas a blank for the working dir example() exit Func Example() ; Display the current working directory. MsgBox($MB_SYSTEMMODAL, "", "The current working directory: " & @CRLF & @WorkingDir) <===== this displays d:Games ; Set the working directory @WorkingDir to the @WindowsDir directory. This is normally C:Windows. FileChangeDir(@WindowsDir) ; Display the working directory after setting it to the windows directory. MsgBox($MB_SYSTEMMODAL, "", "The current working directory: " & @CRLF & @WorkingDir) <==== displays C:Windows EndFunc ;==>Example
JohnOne Posted February 11, 2015 Posted February 11, 2015 What about $var = "d:\Games" FileChangeDir($var) msgbox(0,"working dir: ",@WorkingDir) And FileChangeDir("D:\A-Screenshots") msgbox(0,"working dir: ",@WorkingDir) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
garyf Posted February 11, 2015 Author Posted February 11, 2015 I swapped the order of the two filechangedir and get similar results. They both display a blanks for the working dir. but in the function the first msgbox dispays D:A-Screenshots.
Solution garyf Posted February 11, 2015 Author Solution Posted February 11, 2015 I found it! jeez! The error is in the msgbox. It is incorrectly coded. msgbox(0,"testing 1","working dir: ",@WorkingDir) wrong! msgbox(0,"testing 1","working dir: " & @WorkingDir) correct
JohnOne Posted February 11, 2015 Posted February 11, 2015 (edited) In your code, you have @WorkingDir as a param for MsgBox TimeOut See post >#6 Edited February 11, 2015 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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