Jump to content

run script (not work properly


Recommended Posts

hi all

i have this program once run its has a list of buttons that when clicked run something different in windows xp only

but when i run on button its doesnt run it like it runs when u personally click on it in its file destination hmm ill show

#cs ----------------------------------------------------------------------------

 AutoIt Version: 3.2.9.14 (beta)
 Author:         myName

 Script Function:
    Template AutoIt script.

#ce ----------------------------------------------------------------------------

; Script Start - Add your code below here
#include <GUIConstants.au3>

#include <GUIConstants.au3>


#Region ### START Koda GUI section ### Form=f:\documents and settings\fred\my documents\scripts\scripitng programs\formdesign\forms\form2.kxf
$Form1_1 = GUICreate("run it", 357, 264, 262, 142)
GUISetBkColor(0x0054E3)
$Label1 = GUICtrlCreateLabel("paint", 16, 24, 27, 17)
$Label2 = GUICtrlCreateLabel("msn", 16, 56, 36, 17)
$Label3 = GUICtrlCreateLabel("word", 16, 104, 36, 17)
$Label4 = GUICtrlCreateLabel("calc", 16, 152, 36, 17)
$Label5 = GUICtrlCreateLabel("dos", 16, 192, 36, 17)
$Button1 = GUICtrlCreateButton("run", 64, 16, 49, 25, 0)
GUICtrlSetBkColor(-1, 0xFF0000)
$Button2 = GUICtrlCreateButton("run", 64, 56, 49, 25, 0)
GUICtrlSetBkColor(-1, 0x00FF00)
$Button3 = GUICtrlCreateButton("run", 64, 96, 49, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Button4 = GUICtrlCreateButton("run", 64, 144, 49, 25, 0)
GUICtrlSetBkColor(-1, 0x00FFFF)
$Button5 = GUICtrlCreateButton("run", 64, 192, 51, 25, 0)
GUICtrlSetBkColor(-1, 0xC0DCC0)
$Label6 = GUICtrlCreateLabel("RUN IT", 152, 0, 41, 17)
$Label7 = GUICtrlCreateLabel("run it used to run programs since 2008", 128, 24, 184, 17)
$Label8 = GUICtrlCreateLabel("RDC", 144, 56, 36, 17)
$Label9 = GUICtrlCreateLabel("taskmgr", 144, 104, 36, 17)
$Label10 = GUICtrlCreateLabel("comand", 144, 200, 42, 17)
$Label11 = GUICtrlCreateLabel("chat", 144, 152, 42, 17)
$Button6 = GUICtrlCreateButton("run", 200, 48, 49, 25, 0)
GUICtrlSetBkColor(-1, 0x800080)
$Button7 = GUICtrlCreateButton("run", 200, 96, 49, 25, 0)
GUICtrlSetBkColor(-1, 0x008000)
$Button8 = GUICtrlCreateButton("run", 200, 144, 51, 25, 0)
GUICtrlSetBkColor(-1, 0x808080)
$Button9 = GUICtrlCreateButton("run", 200, 192, 51, 25, 0)
GUICtrlSetBkColor(-1, 0x800000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button1
            Run("mspaint.exe")
        case $Button2
            if FileExists("F:\Program Files\Messenger\msmsgs.exe") then 
    Run("F:\Program Files\Messenger\msmsgs.exe")
Else
    Run("C:\Program Files\Messenger\msmsgs.exe")
endif
            Case $Button3
if FileExists("F:\Program Files\Windows NT\Accessories\wordpad.exe") then 
    Run("F:\Program Files\Windows NT\Accessories\wordpad.exe")
Else
    Run("C:\Program Files\Windows NT\Accessories\wordpad.exe")
endif
                
            case $Button4
                Run("calc.exe")
                
            case $button5
                Run("cmd.exe")
                
            case $Button6
if FileExists("C:\WINDOWS\system32\mstsc") then 
    Run("C:\WINDOWS\system32\mstsc")
Else
    Run("F:\WINDOWS\system32\mstsc")
endif
            
        case $Button7
        if FileExists("C:\WINDOWS\system32\taskmgr") Then
            Run("C:\WINDOWS\system32\taskmgr")
        Else
            Run("F:\WINDOWS\system32\taskmgr")
        endif
        
    case $Button8
        if FileExists("C:\WINDOWS\system32\winchat") then
            Run("C:\WINDOWS\system32\winchat")
        Else
            Run("F:\WINDOWS\system32\winchat")
            endif
            
        case $button9
            if FileExists("C:\WINDOWS\system32\command.com") then
                Run("C:\WINDOWS\system32\command.com")
            Else
                Run("F:\WINDOWS\system32\command.com")
                endif
            
    EndSwitch
WEnd

click on last button comand

it should show up liek a cmd window

instead it shows up blank

anwy clues y?

cheers C.W

C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

Link to comment
Share on other sites

Just change that Case to this:

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        
        ; ...
        
        Case $Button9
            Run(@ComSpec)
    EndSwitch
WEnd

The @ComSpec macro will find the appropriate console executable wherever it's hiding.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Just change that Case to this:

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        
        ; ...
        
        Case $Button9
            Run(@ComSpec)
    EndSwitch
WEnd

The @ComSpec macro will find the appropriate console executable wherever it's hiding.

:)

hahha sorry m8 u got it wrong im trying to runt eh winodws 98 version of dos on xp xp comes wiht 2 different dos command and cmd im trying to run command

lol sorry wrong

cheers C.W

C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

Link to comment
Share on other sites

Well, that doesn't make it much harder:

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
       
        ; ...
       
        Case $Button9
            Run(@ComSpec & " /c command.com")
    EndSwitch
WEnd

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Well, that doesn't make it much harder:

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
       
        ; ...
       
        Case $Button9
            Run(@ComSpec & " /c command.com")
    EndSwitch
WEnd

:)

WOW thnx m8 someones smart :P

lol i would never have figured that out by myself

Where did u learn autoit?

people always say "you should learn autoit its easy" but in order to learn something u need a guide to learn with has anybody thought of writing a guide for this?

if not anybody want me to write 1? vote yes or no

C.Wnew rules:1.dont use plz in a post or title use please instead2.always use help file as it is now muchly over rated3. dont think where not watching u4.please wait 24 hours after last post ot bump XD i use to make that mistake

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