wjp79 0 Posted April 21, 2008 Share Posted April 21, 2008 Hello people i'm new to autoit and I am having a little trouble get my script going. I created a script that writes a text file to a directory. But the directory has to be matched with the computername. For example the computer name is "computer1" the directory also needs to have that name -->. k:\test\computer1 <----\test.txt Here is my script: ;variabelen $root= "K:\beheer\domdata\" & @ComputerName & "\" <------------------------ $soft= "zsm" ;uitvoeren FileWrite($root & $soft & ".txt", "begin bij " & @HOUR & ":" & @MIN & @CRLF) Does anyone have a solution, or want to contribute. Thx in advance. Wierd Jan Link to post Share on other sites
monoceres 196 Posted April 21, 2008 Share Posted April 21, 2008 Use DirCreate() to create the folder before creating the file: DirCreate($root) Broken link? PM me and I'll send you the file! Link to post Share on other sites
wjp79 0 Posted April 21, 2008 Author Share Posted April 21, 2008 (edited) Use DirCreate() to create the folder before creating the file: DirCreate($root) Too quick. Solved it. $root= "K:\beheer\domdata\" $soft= "zsm" $computername= @ComputerName DirCreate($root & @ComputerName) FileChangeDir($root & @ComputerName) FileWrite($soft & ".txt", "begin bij " & @HOUR & ":" & @MIN & @CRLF) Thx for pushing me in the right direction! Edited April 21, 2008 by wjp79 Link to post Share on other sites
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