Skitty Posted January 1, 2011 Posted January 1, 2011 (edited) $Pass = IniRead(@ProgramFilesDir & "\AppData\$~settings.ini", "Password") Run(@ProgramFilesDir & "\AppData\sda.exe" & $Password) As you might have noticed, I'm trying to send my program a variable but I can't quite seem to get this right... How would you go about doing this? @comspec or something? Edit: My variable is suposed to be a command line argument e.g = Start C:\Program Files\AppData\sda.exe 12345 where as 12345 = $password Edited January 1, 2011 by xJSLRx
KaFu Posted January 1, 2011 Posted January 1, 2011 (edited) if not StringInStr(FileGetAttrib(@ProgramFilesDir & "\AppData\"),"D") then DirCreate(@ProgramFilesDir & "\AppData\") IniWrite(@ProgramFilesDir & "\AppData\$~settings.ini", "Settings", "Password", "12345") $sFilename_Exe = @ProgramFilesDir & "\AppData\sda.exe" $Password = IniRead(@ProgramFilesDir & "\AppData\$~settings.ini", "Settings", "Password", "") If $Password Then If FileExists($sFilename_Exe) Then Run($sFilename_Exe & " " & $Password) Else ConsoleWrite("! " & $sFilename_Exe & " not found" & @CRLF) EndIf Else ConsoleWrite("! Password not set" & @CRLF) EndIf Edit: Added some checks. Edited January 1, 2011 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
kylomas Posted January 1, 2011 Posted January 1, 2011 xJSLRX, Looks like you are passing on the password...look at the code carefully and you will see what I mean.Happy New Year !!!kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
kylomas Posted January 1, 2011 Posted January 1, 2011 kafu, You're no fun after an all nighter on new years eve... kylomas Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
Skitty Posted January 1, 2011 Author Posted January 1, 2011 (edited) if not StringInStr(FileGetAttrib(@ProgramFilesDir & "\AppData\"),"D") then DirCreate(@ProgramFilesDir & "\AppData\") IniWrite(@ProgramFilesDir & "\AppData\$~settings.ini", "Settings", "Password", "12345") $sFilename_Exe = @ProgramFilesDir & "\AppData\sda.exe" $Password = IniRead(@ProgramFilesDir & "\AppData\$~settings.ini", "Settings", "Password", "") If $Password Then If FileExists($sFilename_Exe) Then Run($sFilename_Exe & " " & $Password) Else ConsoleWrite("! " & $sFilename_Exe & " not found" & @CRLF) EndIf Else ConsoleWrite("! Password not set" & @CRLF) EndIf Edit: Added some checks. I see the trick was in & " " & Thanks KaFu, this was very helpful. happy new year! Edited January 1, 2011 by xJSLRx
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