Shellpath problem

I need to run an utility program who I have bundled within my application using cmd.exe on Windows, so I have to create a Shell command line with the correct path to the executable.

To find where is my executable I use, either Folderitem.nativepath or folderitem.shellpath, but neither of them return a usable cmd path.I got as return path an UNC path who cmd do not accept .

This is what I got:
Build with the Shellpath returned data:
\ALFA-PC\userfolder\INK-CC~1\DEBUGI~1bin\commandfile.exe -r 300 -jpeg -singlefile “C:\test_input\inputfile.pdf.pdf” C:\Users\userfolder\AppData\Local\Temp\949068

And this what I need:
Require shell path:
C:\userfolder\InkCC\DebugInkCC\bin\commandfile.exe -r 300 -jpeg -singlefile “C:\test_input\inputfile.pdf” C:\Users\userfolder\AppData\Local\Temp\949068

Any idea on how may I get the correct path?
Thank you for any help… is about 3 days who I spent my time to find a solution, of course on Mac work correct…
PS: I really do not understand why XOJO people do not correct the library!!

Hi Sergio,

I usually start solving these kinds of issues by slowly dissecting the issue. What does the output look like when you run something like this:

Var f As FolderItem

For i As Integer = 0 To FolderItem.DriveCount - 1
  f = FolderItem.DriveAt(i)
  System.DebugLog("Drive#: " + i.ToString + " f.Name: " + f.Name)

…which may give you something like this…

// DriveAt(0) is the C: drive
// DriveAt(1) is the D: drive 
// DriveAt(2) is the E: drive 
// DriveAt(3) is the F: drive
// DriveAt(4) is the G: drive
// DriveAt(5) is the S: drive

…allowing you use the .DriveAt() like this…

Var f, f_path As FolderItem
f_path = FolderItem.DriveAt(2).Child("test_input")
Var FileName As String = ...the rest of your path and .exe goes here...
f = New FolderItem(f_path.NativePath + FileName, FolderItem.PathModes.Native)

…you may need to experiment, set a breakpoint and send the f_path.NativePath to the debug and evaluate what’s happening as you build your way thru this.

Make sure you’ve got it pointing where you think. The path you got should work, but it looks like you’re getting a short path that points to a network share instead of a physical drive.

According to the docs, ShellPath returns the short path if it exists and the “long” path if it doesn’t, but the reality is that they should both work.

The other thing you could do is use the NativePath and just make sure to put quotes around it.