sandyd Posted October 27, 2004 Share 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 ]--- Link to comment Share on other sites More sharing options...
JSThePatriot Posted October 27, 2004 Share Posted October 27, 2004 What I would do is... Run(@ComSpec & " /c start " & $infilename) JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Developers Jos Posted October 27, 2004 Developers Share 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. Link to comment Share on other sites More sharing options...
JSThePatriot Posted October 27, 2004 Share Posted October 27, 2004 What about my example guys? Does everyone prefer not to use the @ComSpec and if so why? JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
Developers Jos Posted October 27, 2004 Developers Share 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. Link to comment Share on other sites More sharing options...
JSThePatriot Posted October 27, 2004 Share Posted October 27, 2004 Thanks JdeB... that explains it. JS AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
scriptkitty Posted October 27, 2004 Share 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. Link to comment Share on other sites More sharing options...
sandyd Posted October 28, 2004 Author Share 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 ]--- 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