Jump to content
Sign in to follow this  
Protheus

Assistance of If... Then statement

Recommended Posts

Hello all,

On our network we have several machines that are not on the domain - what I want to do is then when I send a software package to them it enters the network name in the run window and if a logon windows appears it fills in the logon information ortherwise it connect to the network drive.

So i created this scritp so far:

Send ("#r")
Send ("\\gandalf\software$\Standard Applications\Acrobat Reader 7\Acrobat Reader 7.exe {ENTER}")

If WinActive  ("Connect to gandalf.msi.cell") Then 
    MsgBox (64, "Test Networking", "Gandalf window is open")
EndIf

- So this opens the Run windows

- Enters the network name and press enter

- So as I am working offline I have to logon - so the logon windows comes up.

But now the message (as a sort of test) is not coming up

What is wrong so far ?

Share this post


Link to post
Share on other sites

When in this type of problem, always look at what condition the If statment is testing... The window "Connect to gandalf.msi.cell" is not becoming active.


qq

Share this post


Link to post
Share on other sites

In other words try WinExist() for the test, and you can then call WinActivate() if the window exists


Writing AutoIt scripts since
_DateAdd("d", -2, _NowCalcDate())

Share this post


Link to post
Share on other sites

ARe you like able to add several lines of code in the Then statement like:

If ........ Then

do this

do this also

and do this afterwards

EndIf

Edited by Protheus

Share this post


Link to post
Share on other sites

ARe you like able to add several lines of code in the Then statement like:

If ........ Then

  do this

  do this also

  and do this afterwards

EndIf

<{POST_SNAPBACK}>

Yes of course you can.

I hope you aren't in the IT dept there lol :(

Share this post


Link to post
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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...