Jump to content

condition logic


Recommended Posts

cant see why I dont get to the last step where it does the regwrite (there are machines that dont add +1 to the errorcount)

is something wrong with my logic?

For $x = 1 to $assets[0]
$errorcount = 0
$status="1"

Ping($assets[$x])
If @error Then
$status="OFFLINE"
$errorcount =+1
EndIf

If $errorcount = 0 Then
RegRead ( "\\" & $assets[$x] & "\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion", "ProgramFilesDir" )
If @error Then
$status="NO_ADMIN_RIGHTS"
$errorcount =+1
EndIf
EndIf

If $errorcount = 0 Then
RegWrite("\\" & $assets[$x] & "\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment", "CGGROUP", "REG_SZ", "INVEST_TRADING")
EndIf

Next
Link to comment
Share on other sites

  • Moderators

Well, the easy way is to debug it... what is $errorcount before you get there... again, another topic you could simply solve on your own with some effort.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...