Matthew VanDerlofske Posted April 14, 2006 Share Posted April 14, 2006 Having an issue with spaces when calling a program. to resolve I need to put quotes around a string. How do I do that. Here is my code: #include <GUIConstants.au3> GUICreate(" My GUI input acceptfile", 320,120, @DesktopWidth/2-160, @DesktopHeight/2-45, -1, 0x00000018); WS_EX_ACCEPTFILES $file = GUICtrlCreateInput ( "", 10, 5, 300, 20) GUICtrlSetState(-1,$GUI_DROPACCEPTED) GUICtrlCreateInput ("", 10, 35, 300, 20) ; will not accept drag&drop files $btn = GUICtrlCreateButton ("Ok", 40, 75, 60, 20) GUISetState () $msg = 0 While $msg <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $btn exitloop EndSelect Wend Run("C:\DOCSTAR\DSCLIENT.EXE " & GUICtrlRead($file)) The issue is that if a files location has spaces it will not work. I need to put quotes around the file path. Link to comment Share on other sites More sharing options...
Developers Jos Posted April 14, 2006 Developers Share Posted April 14, 2006 Run('C:\DOCSTAR\DSCLIENT.EXE "' & GUICtrlRead($file) & '"') 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...
Valuater Posted April 14, 2006 Share Posted April 14, 2006 i use $file = FileGetShortName("C:\DOCSTAR\DSCLIENT.EXE " & GUICtrlRead($file)) Run($file) 8) Link to comment Share on other sites More sharing options...
MHz Posted April 15, 2006 Share Posted April 15, 2006 i use $file = FileGetShortName("C:\DOCSTAR\DSCLIENT.EXE " & GUICtrlRead($file)) Run($file) 8)FileGetShortName() fails to convert 2 files at once to shortname. I believe you just wanted to use it on the GUICtrlRead() only. 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