Shell

Wizarda2z

Member
Licensed User
Is there any way to get around this:-

shell("textedit.exe", "\storage card\program files\test.txt")

It seems that any directory that contains spaces is not valid to the shell command on the PPC or desktop.

I've tried padding the spaces with the '_' but to no avail.

Single name directories work ok eg.

shell("textedit.exe", "\temp\temp\test.txt")

A bit baffled here!:(
 

Erel

Administrator
Staff member
Licensed User
What you want to run is: textedit.exe "\storage card\program files\test.txt"
You need to add the quotes:
B4X:
shell("textedit.exe", chr(34) & "\storage card\program files\test.txt" & chr(34))
 

Wizarda2z

Member
Licensed User
Shell and Pword

I just thought that I'd mention that when using the shell command to open Pocket word documents, the chr(34) codes should be ommited from the files path otherwise Pword raises an error.

It took me a wile surfing the net to find this out because I couldn't understand what I was doing wrong!

eg shell("pword.exe", "storage card\my documents\mifile.doc")

NOT shell("pword.exe", chr(34) & "storage card\my documents\mifile.doc" & chr(34))

Microsoft's fault I think!
 
Top