Sign in to follow this  
Followers 0
Matthew VanDerlofske

Passing Quotes In A String.

4 posts in this topic

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.

Share this post


Link to post
Share on other sites



i use

$file = FileGetShortName("C:\DOCSTAR\DSCLIENT.EXE " & GUICtrlRead($file))

Run($file)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0