C4sToR Posted May 20, 2008 Posted May 20, 2008 hi everybody, just discovered autoit to do some automatic thing as configuring some applications and other. i made a script that open a .txt file read the group and create them that work perfect. just wanna know how i can do it in order the .txt files will not be put in the autoit script but in parameters as for example : creategroupe group.txt it will permit me to give in parameters all the files i want without changing the .exe anyone can help me doing this below, an example of my actual script : $file = FileOpen("c:\Admintools\Config\fctel.cvs", 0) ; Check if file opened for reading OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf ; Read in 1 character at a time until the EOF is reached While 1 $line = FileReadLine($file, 2) If @error = -1 Then ExitLoop $array = StringSplit($line, ';', 1) MsgBox (0, "Séparation", $array[1]) Run("cmd.exe") Sleep(2000) Send("C:") Send("{ENTER}") Sleep(2000) Send("cd Admintools") Send("{ENTER}") Sleep(2000) Send("cd config") Send("{ENTER}") Sleep(2000) ;lancement de SamACL.exe Send(" SamACL.exe -s -d Account -a " & $array[1] )
Xenobiologist Posted May 20, 2008 Posted May 20, 2008 Hi, you can create a GUI to input your parameter or just use $cmdline Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times
C4sToR Posted May 20, 2008 Author Posted May 20, 2008 oki it works well with the $cmdline my other question is how can i skip the first line of the txt cuz its match with the label : GROUP and i wanna skip this line but can find any function to skip lines on fileopen or filereadlines
Zedna Posted May 20, 2008 Posted May 20, 2008 my other question is how can i skip the first line of the txt cuz its match with the label : GROUP and i wanna skip this line but can find any function to skip lines on fileopen or filereadlines #include <File.au3>_FileReadToArray()Then you may go through the lines by FOR NEXT loop and start from line 2 Resources UDF ResourcesEx UDF AutoIt Forum Search
C4sToR Posted May 20, 2008 Author Posted May 20, 2008 there are no means to do it such as in dos with the for and the options that skip the lines you want ?
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