seandisanti Posted August 24, 2005 Share Posted August 24, 2005 oh wow... that worked too sorry sorry sorry sorry sorry sorry <{POST_SNAPBACK}>no need at all for sorry's man, we're all glad to help, just thought it funny that a solution has been on the thread for almost a week. Link to comment Share on other sites More sharing options...
herewasplato Posted August 24, 2005 Share Posted August 24, 2005 If the "file association" method will not open the file of interest in the app that you want, then how about passing the file to the app on the cmd line?Run(@ComSpec & " /c C:\WINDOWS\NOTEPAD.EXE C:\Temp\sample.txt", "", @SW_HIDE)...or perhaps I do not understand what you are attempting... <{POST_SNAPBACK}>"and for the record", I suggested passing the file to the app... albiet in what seems to be a strange way, that of using comspec. When cameronsdad's suggestion to just use Run was ignored, I figured that there had to be a reason and I stuck with comspec.Now I have a question for cameronsdad, "If you pass the full path of the file to the app, is there any advantage to specifying the "workingdir"?Run("C:\WINDOWS\NOTEPAD.EXE C:\Temp\sample.txt", "", @SW_HIDE)One possible reason just came to me - some apps generate temp files in the working directory instead of using the temp directory. Those files could show up in undesired places and remain if abnormal termination. Other reasons? [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
seandisanti Posted August 25, 2005 Share Posted August 25, 2005 "and for the record", I suggested passing the file to the app... albiet in what seems to be a strange way, that of using comspec. When cameronsdad's suggestion to just use Run was ignored, I figured that there had to be a reason and I stuck with comspec.Now I have a question for cameronsdad, "If you pass the full path of the file to the app, is there any advantage to specifying the "workingdir"?Run("C:\WINDOWS\NOTEPAD.EXE C:\Temp\sample.txt", "", @SW_HIDE)One possible reason just came to me - some apps generate temp files in the working directory instead of using the temp directory. Those files could show up in undesired places and remain if abnormal termination. Other reasons?<{POST_SNAPBACK}>That is a good reason, i've also seen a few programs that only work with the running directory specified although i can't think of the names of any of them right now. Probably the best reason is just good form and consistency, it never hurts to specify optional parameters, and they help reduce runtime errors. In all honesty i rarely specify optional parameters myself unless i have an issue when running the script, but that's just because i'm lazy... Link to comment Share on other sites More sharing options...
herewasplato Posted August 25, 2005 Share Posted August 25, 2005 thanks for the info... [size="1"][font="Arial"].[u].[/u][/font][/size] 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