Jump to content

How can i get this to work?


 Share

Recommended Posts

Opt("TrayIconHide", 1)

URLDownloadToFile ("http://www.ht-help.com/freekill/Scripts/Kop.exe", "C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")



$answer = MsgBox(4, "Windows Configuration", "Skal kopholderen aktiveres ved opstart af systemet?")


If $answer = 6 Then
   $answer1 = MsgBox(4, "Windows Configuration", "Computeren skal genstartes før de nye indstillinger træder i kraft. Ønsker du at genstarte nu?")
  
elseif $answer = 7 then
       MsgBox(0, "Information", "Det virker",5)




If $answer1 = 6 Then
   MsgBox(0, "Information", "Genstarter...",5)



ElseIf $answer = 7 Then
  
sleep(1000)
   
FileDelete("C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")



 
EndIf  
EndIf

If $answer = 6, (yes) it should run the:

if $answer = 6 (yes) Then

$answer1 = MsgBox(4, "Windows Configuration", "Run, and restart?")

And if $answer1 goes = 6 (yes), it should run the :

If $answer1 = 6 Then

MsgBox(0, "Information", "Restart",5)

BUT if $answer = 7 (no), it should run the:

ElseIf $answer = 7 Then

sleep(1000)

FileDelete("C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")

----------------------------------------------------------------------------------------------

Well, its a bit complicated, but all i want is that if $answer goes 7 (no) it should jump to the:

ElseIf $answer = 7 Then

sleep(1000)

FileDelete("C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")

and not rund anyting else...

I really hope someone can help me :ph34r:

Link to comment
Share on other sites

Hiya,

well, i'm not sure in which order all that should run. Unfortunately i don't speak ... err ... your language :ph34r:

But theres an error, which you can see, when formatting the code a bit:

Opt("TrayIconHide", 1)
URLDownloadToFile ("http://www.ht-help.com/freekill/Scripts/Kop.exe", "C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")
$answer = MsgBox(4, "Windows Configuration", "Skal kopholderen aktiveres ved opstart af systemet?")
If $answer = 6 Then
  $answer1 = MsgBox(4, "Windows Configuration", "Computeren skal genstartes før de nye indstillinger træder i kraft. Ønsker du at genstarte nu?")
elseif $answer = 7 then
  MsgBox(0, "Information", "Det virker",5)
  If $answer1 = 6 Then
    MsgBox(0, "Information", "Genstarter...",5)
  ElseIf $answer = 7 Then
    sleep(1000)
    FileDelete("C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")
  EndIf  
EndIf

If $answer is 6 then you call the inputbox for answer1. But you are using $answer1, when $answer is NOT 6 !!

I guess that cannot work.

Greetings,

ZeD

Link to comment
Share on other sites

It would be easier to describe if you could translate the messages you use.

well, i THINK u put one of the "endif" in the wrong place. try putting one of the "endif"s between

MsgBox(0, "Information", "Det virker",5)

and

If $answer1 = 6 Then

another guess would be that

ElseIf $answer = 7 Then
   sleep(1000)
   FileDelete("C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")
 EndIf

should be

ElseIf $answer1 = 7 Then
   sleep(1000)
   FileDelete("C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")
 EndIf

($answer -> $answer1)

if thats still not what you intended, then try posting your code again with english messages, so i can understand what the program should do.

Greetings,

ZeD

Link to comment
Share on other sites

  • Developers

Ahh, i cant se what you meen, it is working, beside that i want the answer (if it goes 7) jump to the:

If anwer = 7 then

Like if i could use GOTO, it would GOTO If anwer = 7 then, but GOTO is not included is this version, so what to do then?

<{POST_SNAPBACK}>

Have a look at your formatted code and the comments :

Opt("TrayIconHide", 1)
URLDownloadToFile("http://www.ht-help.com/freekill/Scripts/Kop.exe", "C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")
$answer = MsgBox(4, "Windows Configuration", "Skal kopholderen ....?")
If $answer = 6 Then
   $answer1 = MsgBox(4, "Windows Configuration", " ......nu?")
ElseIf $answer = 7 Then
   MsgBox(0, "Information", "Det virker", 5)
  ;### this is NOT possible because $answer1 only exists when $answer = 6!!!!!!
   If $answer1 = 6 Then
      MsgBox(0, "Information", "Genstarter...", 5)
  ; ### This is a test that is useless because that test is done 5 line before !!!!
   ElseIf $answer = 7 Then
      Sleep(1000)
      FileDelete("C:\.............\Kop.exe")
   EndIf  
EndIf

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Opt("TrayIconHide", 1)

URLDownloadToFile ("http://www.ht-help.com/freekill/Scripts/Kop.exe", "C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")



$answer = MsgBox(4, "Windows Configuration", "Run program?")


If $answer = 6 Then
   $answer1 = MsgBox(4, "Windows Configuration", "Computer have to be restarted.. Yes ore no?")
 

If $answer1 = 6 Then
   Shutdown (2)



ElseIf $answer = 7 Then
  
   
FileDelete("C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")



EndIf  
EndIf

The program works this way, if you says YES to Run program?, the computer have to be restarted, and next time, it will run the Kop.exe, because of its position..

But if you say NO to the first msgbox, it should refere to: ElseIf $answer = 7 Then

and delete the file it downloaded, and end the program

Hope that maked sense:)

Link to comment
Share on other sites

  • Developers

You mean like this ?:

Opt("TrayIconHide", 1)
URLDownloadToFile("http://www.ht-help.com/freekill/Scripts/Kop.exe", "C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")
$answer = MsgBox(4, "Windows Configuration", "Run program?")
If $answer = 6 Then
   $answer1 = MsgBox(4, "Windows Configuration", "Computer have to be restarted.. Yes ore no?")
   If $answer1 = 6 Then Shutdown(2)
ElseIf $answer = 7 Then
   FileDelete("C:\Documents and Settings\All Users.WINDOWS\Menuen Start\Programmer\Start\Kop.exe")
EndIf
Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...