sandyd 0 Posted October 27, 2004 Hi all,First post to this forum so dont be too harsh on me.I have the following code:$infilename = @TempDir & "\list.txt" ... put some text into list.txt ... Run("c:\windows\notepad.exe" & $infilename)The error msg i get is:Line 37 (File "G:\Scripts\NewMachinesOnNetwork.aut"):Run("c:\windows\notepad.exe" & $infilename)Error: Unable to execute the external program.The filename, directory name, or volume label syntax is incorrect.Am I using the wrong syntax for the Run command? How can I get notepad to open my file?Sandy ----[ SandyD ]--- Share this post Link to post Share on other sites
JSThePatriot 18 Posted October 27, 2004 What I would do is... Run(@ComSpec & " /c start " & $infilename) JS AutoIt LinksFile-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.ComputerGetInfo UDF's Updated! 11-23-2006External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Share this post Link to post Share on other sites
Jos 2,168 Posted October 27, 2004 $infilename = @TempDir & "\list.txt" ... put some text into list.txt ... Run("c:\windows\notepad.exe" & $infilename)The error msg i get is:Line 37 (File "G:\Scripts\NewMachinesOnNetwork.aut"):Run("c:\windows\notepad.exe" & $infilename)Error: Unable to execute the external program.The filename, directory name, or volume label syntax is incorrect.Am I using the wrong syntax for the Run command? How can I get notepad to open my file?Sandy<{POST_SNAPBACK}> AUT ?????Run command should be:Run('c:\windows\notepad.exe "' & $infilename & '"') SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
JSThePatriot 18 Posted October 27, 2004 What about my example guys? Does everyone prefer not to use the @ComSpec and if so why? JS AutoIt LinksFile-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.ComputerGetInfo UDF's Updated! 11-23-2006External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Share this post Link to post Share on other sites
Jos 2,168 Posted October 27, 2004 What about my example guys? Does everyone prefer not to use the @ComSpec and if so why?JS<{POST_SNAPBACK}>Your post will use the default program for extention ".txt"I don't prefer using @comspec... use it for commandline programs but not for Windows programs if not needed.I guess the reason of my post was to show how to correctly do what was tried in the initial post. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Share this post Link to post Share on other sites
JSThePatriot 18 Posted October 27, 2004 Thanks JdeB... that explains it. JS AutoIt LinksFile-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.ComputerGetInfo UDF's Updated! 11-23-2006External LinksVortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Share this post Link to post Share on other sites
scriptkitty 1 Posted October 27, 2004 also Start has a problem with path statements used that way. Try this out. $file="C:\WINNT\Active Setup Log.txt" run(@comspec &' /c start ' & $file) ;or run(@comspec &' /c start "' & $file & '"') AutoIt3, the MACGYVER Pocket Knife for computers. Share this post Link to post Share on other sites
sandyd 0 Posted October 28, 2004 Thanks to everyone that replied. Had looked at it that much, I'd never noticed that I needed a space between notepad.exe and the filename. Cheers again Sandy ----[ SandyD ]--- Share this post Link to post Share on other sites