bobheart Posted May 28, 2004 Share Posted May 28, 2004 (edited) I'm using this Run("notepad.exe "&@Scriptdir&"\*.txt",@WindowsDir,) To open a txt file that the file name will change from computer to computer but it will end with .txt . so how would I open the only txt file that will be in the main folder ? Right now it gives me an error that it can't find the file . I know I'm a pest .. lol I should add a bat file is making the txt file and getting the name from the computer . so if it was johns computer it would be john.txt Edited May 28, 2004 by bobheart Link to comment Share on other sites More sharing options...
CyberSlug Posted May 28, 2004 Share Posted May 28, 2004 (edited) Untested code, but should point you to the right functions in the help file. Also see FAQ #7 & 9 in the help file for issues about quotation marks. $searchHandle = FileFindFirstFile( @Scriptdir & "\*.txt" ) If $searchHandle = -1 Then MsgBox(4096,"Error","File not found...quitting.) Exit EndIf $filename = FileFindNextFile($searchHandle) Run("notepad.exe " & """" & $filename & """",@WindowsDir) Edit: Neeed to put a space after notepad.exe Edited May 28, 2004 by CyberSlug Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
bobheart Posted May 28, 2004 Author Share Posted May 28, 2004 (edited) Whats a closing quote ? --------------------------- AutoIt Error --------------------------- Line 32 (File "C:\Documents and Settings\Candles\My Documents\My Downloads\history test\Text16.au3"): MsgBox(4096,"Error","File not found...quitting") MsgBox(4096,"Error",^ ERROR Error: String missing closing quote. --------------------------- never mind got that MsgBox(4096,"Error","File not found...quitting") still not finding the file ? Edited May 28, 2004 by bobheart Link to comment Share on other sites More sharing options...
CyberSlug Posted May 28, 2004 Share Posted May 28, 2004 Whats a closing quote ?It means I made a typo Here's the fixMsgBox(4096,"Error","File not found...quitting.")Notice the closing quote mark before the closing paren. Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
bobheart Posted May 28, 2004 Author Share Posted May 28, 2004 Ya I found it right after I posted that . lol but still can't find that damn txt file .. Link to comment Share on other sites More sharing options...
Valik Posted May 28, 2004 Share Posted May 28, 2004 That's because Notepad doesn't accept wildcards for opening a file. Link to comment Share on other sites More sharing options...
bobheart Posted May 28, 2004 Author Share Posted May 28, 2004 That's because Notepad doesn't accept wildcards for opening a file.What will i can change the name to html ,doc ? Link to comment Share on other sites More sharing options...
bobheart Posted May 28, 2004 Author Share Posted May 28, 2004 I take it this can't be done then ? If not all try something else . Link to comment Share on other sites More sharing options...
bobheart Posted May 28, 2004 Author Share Posted May 28, 2004 Yes I saw it but did not understand it . Link to comment Share on other sites More sharing options...
bobheart Posted May 28, 2004 Author Share Posted May 28, 2004 Never mind I got it to work . Link to comment Share on other sites More sharing options...
bobheart Posted May 28, 2004 Author Share Posted May 28, 2004 Thank you larry that work fine .. Sorry i don't know this stuff and I keep asking for help .. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now