Jump to content
Sign in to follow this  
apollo13

Please can you help me

Recommended Posts

apollo13

I'm looking for a "string command" that permit me to run the EXE file produced compiling AutoIT script

in addiction a second name as do the batch file with %1 %2 %3...

i have reads in the guide lots command and i have search in google %1 "script" but nothing to do.

Exist the possibility ??

File.exe name1 or name2.....

in batch file is

BATCH %1

Running:

if %1=="name" goto.....

ifg%1=="name2" goto......

exist in autoit some similar command??

I don't kno how what I must serach to find it'

Can someone help me??

Share this post


Link to post
Share on other sites
JLogan3o13

Apollo13, you are unfortunately not being very clear in your description. Are you looking for a way to run one executable and then another, or are you looking for a way to run an executable based on a variable? In either case, AutoIt does not have a "goto" feature; you need to look up "Func" in the help file to do what you need.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
apollo13

Apollo13, you are unfortunately not being very clear in your description. Are you looking for a way to run one executable and then another, or are you looking for a way to run an executable based on a variable? In either case, AutoIt does not have a "goto" feature; you need to look up "Func" in the help file to do what you need.

I want create different link to EXE files compiled.

This link are composed "filename.exe %1"

Each link is follow with the name of user choice that permit

to create different files in a common directory with a virtual machine, that interpreter these name file and do different work

when the virtual machine startup

Different files different action to do.

For this reason is important that I have an automatic input (using %1), without user keyboard input .

Thanks

Share this post


Link to post
Share on other sites
apollo13

Apollo13, you are unfortunately not being very clear in your description. Are you looking for a way to run one executable and then another, or are you looking for a way to run an executable based on a variable? In either case, AutoIt does not have a "goto" feature; you need to look up "Func" in the help file to do what you need.

An exe with a variable NOT a goto.

I use While-Wend and not goto!

%1 is variable that permit me to do different function.

I must run exe with different value of %1 in input of the exe.

is more clear now ??

thank you very much.

If is not clear i can post an example.

Share this post


Link to post
Share on other sites
saywell

How about shellexecute?

William

Share this post


Link to post
Share on other sites
BrewManNH

I believe what you're looking for is Command Line parameters. Look in the Help file in the section called "Using AutoIT" for a description of how to use command line parameters in your scripts.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
somdcomputerguy

I may know what you're trying to do. You'll want to look at Command Line Parameters, and Loop Statements - For...To...Step...Next. Here's some quick code using those topics.

If $CmdLine[0] > 0 Then
    For $a = 1 To $CmdLine[0]
        ;
        MsgBox(0, "What to do?", "Argument " & $a & " is " & $CmdLine[$a] & ".")
        ;
    Next
Else
    MsgBox(0, '', 'Nothing to do.')
EndIf
Edited by somdcomputerguy

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
apollo13

Thanks for your patience.

Now I explain you each step in order to better explain what I'm looking for to do.

This is the file batch "START.BAT" that I use for now to do that I want, also if

I prefer convert batch command into AutoIT command script because it has lots options

that permit me to better improve START with new functions, using mouse position and its button

control process, close Windows etc...

Unfortunately I am stopped because I don't know how I can do into AutoIT to obtain auto-input using a %1 variable.

Is not a problem for "goto" as You wrote me, because I use AutoIT script command << call ("function") --> Func() .. end func >>

SharedDOC is the directory of Windows7 that is shared with Windows XP Virtual Machine.

================================== BATCH File Win7: ===========================

@echo off

if %1==Office goto Office

if %1==WEB goto WEB

if %1==Dict goto Dict

GOTO Uscita

:Office

prompt>C:SharedDOCOffice.txt

GOTO Uscita

:WEB

prompt>C:SharedDOCWEB.txt

GOTO Uscita

:Dict

prompt>C:SharedDOCDict.txt

GOTO Uscita

:Uscita

C:VIRTUA~3app64VirtualBox.exe --comment "MicroXP" --startvm "b86c6c51-60e4-4742-8014-96a78e452ccd"

exit /B

==============================================================================

ALWAYS IN WIN7

Created this file batch

I have create also 3 equals shortcut link to batch START.BAT

I renamed them into "Office.lnk" + "WEB.lnk" + "Dictionary.lnk"

I have edited each shortcut using mouse Dx Popriety and i have added in field "Target" this

running string with suffix variable %1 in this mode

1st link - "C:Program FilesVirtualBoxStart.bat" Office

2nd link - "C:Program FilesVirtualBoxStart.bat" WEB

3rd link - "C:Program FilesVirtualBoxStart.bat" Dict

When I click on shortcut that I want the batch automatically starts using %1 (without

user input beacuse the input is "%1" included in the running string).

In this mode batch creates a file.txt length 0 byte named "Office" or "WEB" or "Dict"

into the shared directory and then run VirtualBox Session that when is in memory,

automatically launch MicroXP Virtual Image.

================================== BATCH File Win XP: ===========================

When VirtualBox loading XP,

MicroXP have in the "Startup Directory" an other batch "Auto-Run.bat" that verify if there is

and how file is in the shared directory.

For this batch in not a problem to convert into AutoIT script.

I have problem only in the first batch "START.BAT" with %1 input.

D: in not a drive but the shared directory DOC of Win7

@echo off

If Exist D:Office.txt goto Office

If Exist D:WEB.txt goto WEB

If exist D:Dict.txt goto Dict

Exit /B

:office

del d:office.txt

C:ProgramsOfficeWord.exe

C:ProgramsOfficeExcel.exe

C:ProgramsOfficePowerPnt.exe

C:ProgramsDictionaryvocabularyzan.exe

Exit /B

:WEB

del d:WEB.txt

C:programsWEBModemHSDPA_Modem.exe

C:programsWEBFirefoxFirefox.exe

C:programsWEBFoxMailFoxmail.exe

ExiT /B

:Dict

del d:dict.txt

C:ProgramsDictionaryEnglish-ItalianLEC Power Translator.exe

C:ProgramsDictionarySynonymousDictionary.exe

C:ProgramsDictionaryvocabularyzan.exe

Exit /B

=========================

thank you again very much for help

Share this post


Link to post
Share on other sites
somdcomputerguy

Well this might be a start for Start.bat (should be named Start.au3, of course). Introduced here is the Switch..Case statement, kinda like "Do this, based on that".

If $CmdLine[0] = 0 Then
    MsgBox(0, '', 'Nothing to do.')
    Exit
EndIf
Switch $CmdLine[1]
    Case "Office"
        MsgBox(0, 'Office', 'Office stuff to do.')
    Case "WEB"
        MsgBox(0, 'WEB', 'WEB stuff to do.')
    Case "Dict"
        MsgBox(0, 'Dict', 'Dict stuff to do.')
    Case Else
        MsgBox(0, '?', 'Nothing to do with that.')
EndSwitch
Exit ;not really needed here, but..

- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

Share this post


Link to post
Share on other sites
apollo13

Thank you very much.

I have found the command.

Member: "comdcomputerguy" have suggest me posting an example the correct command

$cmdline[1]

Reading AutoIT guide in my italian language the command there isn't because

the translation is stopped to version 3.0.102 and it is not showed on it.

Reading english guide of last version 3.3.8.1 i immediately found this command and testing it

do what I'm looking for.

The last example posted is perfect. Thanks 1.000.0000 :-)

Thank you to all forum members for precious help and patience

and sorry for the disturb

Well this might be a start for Start.bat (should be named Start.au3, of course). Introduced here is the Switch..Case statement, kinda like "Do this, based on that".

If $CmdLine[0] = 0 Then
    MsgBox(0, '', 'Nothing to do.')
    Exit
EndIf
Switch $CmdLine[1]
    Case "Office"
        MsgBox(0, 'Office', 'Office stuff to do.')
    Case "WEB"
        MsgBox(0, 'WEB', 'WEB stuff to do.')
    Case "Dict"
        MsgBox(0, 'Dict', 'Dict stuff to do.')
    Case Else
        MsgBox(0, '?', 'Nothing to do with that.')
EndSwitch
Exit ;not really needed here, but..

Share this post


Link to post
Share on other sites
somdcomputerguy

Yes, I agree, not disturbing at all. Good luck with the rest of your project.


- Bruce /*somdcomputerguy */  If you change the way you look at things, the things you look at change.

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  

×