Sign in to follow this  
Followers 0
Gustorm

Open a website with a $ variable

12 posts in this topic

I have got a problem: I want to open a website For example: www.xxx.com/ , but i need a $yyy after the /(The $yyy is a value got form an input box). Is there a way to do that? So the final website shoul look like this: www.xxx.com/$yyy Hope you can help

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

$Website = "www.xxx.com/" & $yyy

To include a string and a variable, you must use &. For example:

$Input = InputBox("Website", "Enter website after website.com/")

ShellExecute("http://www.website.com/" & $Input)
Edited by JasonB

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

And if i have got that variable in the middle of the address? Like www.x$yyyxx.com

Edited by Gustorm

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

ShellExecute("www.x" & $yyy & "xx.com")

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

Thanks and one last question what isnt really connected to this thread: if i use ShellExecute how can i use * instead of characters after the part of the word? It simply gives me an error when i do that. Example:

ShellExecute(@ScriptDir & "\Data\Ins*.msi") So i want my program to run those msi-s in that folder what begin with Ins. Thanks for you help!

Share this post


Link to post
Share on other sites

how can i use * instead of characters

Use FileFindFirstFile first.

I've never used it, but a search of the help file for "wildcard" returned only 3 entries to scan...


[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

This isnt good. For this I need the filename, and that's the most important, that i only want to write a part of the filename with * instead of the letters(like in windows search: if you dont know the whole filename you can type in a * insted of the missing part. Waiting for solution :)

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

This isnt good. For this I need the filename, and that's the most important, that i only want to write a part of the filename with * instead of the letters(like in windows search: if you dont know the whole filename you can type in a * insted of the missing part. Waiting for solution :)

First of all, did you even look in the helpfile on FileFindFirstFile? It explicitly says that * and ? wildcards are supported.

Secondly, "Waiting for solution" makes it sound like you expect us to do it for you, sorry, but I doubt that's going to happen.

Show us that you made some effort first, then people might be willing to help you out with the problems you (might) have. :P

Edit: Strike that, I guess I was wrong.

Edited by FreeFry

Share this post


Link to post
Share on other sites

; Shows the filenames of all files in the current directory.
$search = FileFindFirstFile(@ScriptDir & "\Data\Ins\" & "*.msi")  

; Check if the search was successful
If $search = -1 Then
    MsgBox(0, "Error", "No files/directories matched the search pattern")
    Exit
EndIf

While 1
    $file = FileFindNextFile($search) 
    If @error Then ExitLoop
    ShellExecuteWait(@ScriptDir & "\Data\Ins\" & $file)
WEnd

; Close the search handle
FileClose($search)

Straight from manual, Should shellexecutewait all MSI in script directory. is this what you mean?

Share this post


Link to post
Share on other sites

Yes it is thank you. I just dont know in which situations should I use &. Freefry: I wrote wating for solution becouse it was boring that I always wrtite Thanks for your help :)

Share this post


Link to post
Share on other sites

Gustorm

I just dont know in which situations should I use

Ok stabbing in the dark here, Are you asking ::

When/Where in Autoit3 can I use wildcards?

When/Where/How should I use the posted code in relation to what I am doing?

C'mon buddy bit more detail goes a long way! :)

Share this post


Link to post
Share on other sites

It was about wildcards... and the & sign. But now I think I understood it :)

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  
Followers 0