lgnihlman Posted November 19, 2007 Posted November 19, 2007 I need a little help with this code: CODE ;read counterfile $cntfile="c:\program\quick\chpsw\pswcnt.txt" $pswcnt=FileRead($cntfile) ;read pwdfile $pswfile=FileOpen("c:\program\quick\chpsw\psw.txt",0) $psw=FileReadLine($pswfile,$pswcnt) FileClose($pswfile) ;Run application ;Run(@ComSpec & " /c " & 'c:\program\quick\quick password User=.gruiweb.adm.kommun' & $psw, "", @SW_HIDE) ;Increase counter $pswcnt = $pswcnt + 1 FileOpen($cntfile,2) FileWriteLine($cntfile,$pswcnt) FileClose($cntfile) Exit The idea is to read the counter file, run the application and then increase the the value in the counter file and save the file. I can't get the $pswcnt = $pswcnt + 1 to work.
weaponx Posted November 19, 2007 Posted November 19, 2007 (edited) Use: $pswcnt += 1 Also you should be writing to an ini file, not plain text. ;read counterfile $cntfile = "c:\program\quick\chpsw\pswcnt.ini" $pswcnt = IniRead($cntfile, "Password", "Count", 0) ;read pwdfile $pswfile = FileOpen("c:\program\quick\chpsw\psw.txt", 0) $psw = FileReadLine($pswfile, $pswcnt) FileClose($pswfile) ;Run application ;Run(@ComSpec & " /c " & 'c:\program\quick\quick password User=.gruiweb.adm.kommun' & $psw, "", @SW_HIDE) ;Increase counter IniWrite($cntfile, "Password", "Count", $pswcnt + 1) Edited November 19, 2007 by weaponx
lgnihlman Posted November 19, 2007 Author Posted November 19, 2007 Use: $pswcnt += 1 Also you should be writing to an ini file, not plain text. ;read counterfile $cntfile = "c:\program\quick\chpsw\pswcnt.ini" $pswcnt = IniRead($cntfile, "Password", "Count", 0) ;read pwdfile $pswfile = FileOpen("c:\program\quick\chpsw\psw.txt", 0) $psw = FileReadLine($pswfile, $pswcnt) FileClose($pswfile) ;Run application ;Run(@ComSpec & " /c " & 'c:\program\quick\quick password User=.gruiweb.adm.kommun' & $psw, "", @SW_HIDE) ;Increase counter IniWrite($cntfile, "Password", "Count", $pswcnt + 1) Thanx !
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