Spaces in shell.execute path

I just can’t get it to work… I always get “… is not recognized as an internal or external command…”

Tried double quoting, but couldn’t make it work…

this is the path of the .exe…

F:\@Hotel Control\impresoras fiscales\_DRIVER_ROMAN\_getlastnumber.exe B

What am i Doing wrong ?
TIA
R

find out the shell path with

dim f as FolderItem = GetOpenFolderItem("") if f <> nil and f.Exists Then MsgBox f.ShellPath end if

well… here’s the problem…

I get F:\@HOTEL~1\IMPRES~1\_DRIVE~1\_GETLA~1.EXE as the shellpath…

is it a xojo thing ? how do I fix it ?

it’s a windows thing

[quote=259635:@Roman Varas]I just can’t get it to work… I always get “… is not recognized as an internal or external command…”

Tried double quoting, but couldn’t make it work…

this is the path of the .exe…

F:\@Hotel Control\impresoras fiscales\_DRIVER_ROMAN\_getlastnumber.exe B

What am i Doing wrong ?
TIA
R[/quote]
Have you trie quotes around the full path ?

send the command so it reads (including the quotes)

        "F:\\@Hotel Control\\impresoras fiscales\\_DRIVER_ROMAN\\_getlastnumber.exe" B

well I found a solution…

sh.Execute(chr(34)+“F:\@Hotel Control\impresoras fiscales\_DRIVER_ROMAN\_getlastnumber.exe”+chr(34), “B”)

I had done this in the past, the problem now, is that I am passing an argument to the exe (“B”) which was messing up with the path as I had wrote next to the filename inside the path… (as it is written in the command line) it like :

sh.Execute(chr(34)+“F:\@Hotel Control\impresoras fiscales\_DRIVER_ROMAN\_getlastnumber.exe B”+chr(34),)

Now it is corrected and it works… I wish I knew everything before trying to make it work…

by the way… this forum really helps a lot… thanks!

On windows you can get the “Short Path” (which is all mangled to 8.3 format) or the “normal path” and I think the difference is .AbsolutePath vs. .ShellPath. And I think later versions of Xojo have .NativePath too.

Generally you want to avoid the short path but there may be some APIs or apps which need it.