ok Mr here is a part of the script
Code:
;§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§ This file contains the function which is called by the button "Start" of "Online test" tab §§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§§
#SingleInstance Force ;;; it allows to run the script even if it is already in a running state
#NoEnv ;;; Avoids checking empty variables to see if they are environment variables (recommended for all new scripts).
#NoTrayIcon ;;;Disables the showing of a tray icon.
SetBatchLines -1 ;;; Determines how fast a script will run (affects CPU utilization) in this case -1 means runs at maximum speed
;Process, Priority, , High
;SendMode,Input
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Online test function;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Function name:hardwareboarddetect
;Calling Control: Start button of "Online test" tab.
;Function Parameters:-
;reg:-It contains the value C:\ETAS\ETKControlPanel%ed% where %ed% is 6.4,6.3 or any other depending upon the ETK Version selected by the user at Startup.
;hd,bc,hdbc:-Are the states of the radio control and if anyone of it is selected then value 1 will be passed to corresponding parameter of this function.
Run C:\ETAS\ETKControlPanel6.4\ETKControlPanel.exe -n ; %reg%\ETKControlPanel.exe -n ;;;%reg% contains the value C:\ETAS\ETKControlPanel6.4 (if version 6.4 is selected or it will be 6.3,6.4....depending upon the version selected by the user) which is read from the registry
WinWaitActive INCA/MAC
WinActivate INCA/MAC
winset,alwaysontop,on,INCA/MAC ;;;INCA/MAC is displayed above all windows if there are any pop ups still it will place INCA/MAC on top of all.
WinActivate,INCA/MAC
WinMove, INCA/MAC,, (A_ScreenWidth/2)-(Width/2), (A_ScreenHeight/2)-(Height/2)
sleep 1000
WinGetPos,,, Width, Height, INCA/MAC
buttonw=50
buttonh=15
WinActivate,INCA/MAC
WinGetActiveStats, Title, Width, Height, X, Y
sleep 2000
version=%A_OSVersion%
if(version="2000")
{
;imageboard=%A_ScriptDir%\Images\Start1.bmp
}
if(version="WIN_XP")
{
imageboard=%A_ScriptDir%\Images\Board1.bmp
}
if(version="WIN_VISTA")
{
;imageboard=%A_ScriptDir%\Images\Start2.bmp
}
WinActivate,INCA/MAC
ImageSearch, OutputVarX, OutputVarY, 5,0 , Width, Height,*100 %imageboard%
if (errorlevel=1)
{
winset,alwaysontop,off,INCA/MAC
FileAppend,Error in detecting the "BOARD" button so further operation of board connect cannot be performed if the button image is change then please place the new image of this button into the images folder with filename as Board1.bmp `n `n,%A_ScriptDir%\txt files\Logfile.txt
FileRead,filecontents,%A_ScriptDir%\txt files\Logfile.txt
GuiControl,2:,logfile,%filecontents%
FileAppend,Error in detecting the "BOARD" button so further operation of board connect cannot be performed if the button image is change then please place the new image of this button into the images folder with filename as Board1.bmp `n `n,%A_ScriptDir%\txt files\History.txt
msgbox,16,Error, Error in detecting the "BOARD" button ,3
}
else
{
winset,alwaysontop,on,INCA/MAC
mousemove, OutputVarX, OutputVarY, 1
mousemove, buttonw/2, buttonh/2, 50, r
click
}
as far as images are concerned i am not able to upload it from company (its the same panel pictures which i uploaded few months back)
well today morning when i started my tool from the shortcut (of the .exe file) it again gave error but when i started it from the .exe file which is placed in the d: directory it worked and when i again run the tool from the shortcut placed on the desktop it started to work
Conclusion: Everytime i have to first run it from the original .exe and then no errors if i try to run from the shortcut so in short if the .exe is run then only its shortcut works otherwise error.....why ?