Jump to content

Recommended Posts

Posted

Greetings,

say, i have a folder where my script is

i want to add a word doc file there and open it by means of autoit

the thing is that i do not want to stick to file name

can i open it sticking to file extension or smth else?

thank you

Posted (edited)

If you are always only going to have that one file in the folder you can use this

$doc = FileFindFirstFile("*.doc")  
$doc = FileFindNextFile($doc) 
ShellExecute($doc)

alternatively if you put the .doc in a folder use can use it like this:

$thefolder = "foldername"

$doc = FileFindFirstFile($thefolder & "\*.doc")  
$doc = FileFindNextFile($doc) 
ShellExecute($thefolder & "\" & $doc)

If you need to open more files or further define the search you can just expand on this.

edit: added folder thingy

Edited by hawky358

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...