wjp79 Posted April 21, 2008 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
monoceres Posted April 21, 2008 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!
wjp79 Posted April 21, 2008 Author 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
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