I’m quite familiar with using the Shell class on the Mac, but moving to Windows 10 (which I know little about) has raised some issues.
A command prompt window pops up when executing a Shell command. When I run Command Prompt from the start menu, if I do not run as administrator, then running my utility in Command causes another Command window to pop up. But if I run as administrator, then it runs the utility in the current Command window. I am guessing that if my Xojo app were to execute the shell command as admin, then perhaps that Command window wouldn’t pop up? What if the user running my software is not an administrator? Any other way to get rid of that window that pops up?
It seems that there can be cases where one needs admin privileges when dealing with files
For instance, when I copied my application up to root ie c:\, my Xojo app was made read-only. I am imagining that the program needs to have admin privileges to write files to the root directory? That seems reasonable. But I think I need a folder where I can write files temporarily, with normal user privileges. And due to problem 3. below, I want a folder that has no spaces in the path. That cannot be guaranteed if the folder is in a user folder, because the user name could have spaces in it. Is there a tmp folder in Windows 10?
- If there is a space in the path, this is a problem for the utility I am running…if that path is one of the arguments. Even if I put it in quotes, the utility doesn’t deal with it properly. Now, I know that SpecialFolder.UserHome will modify the directory with a space…eg “Joe Blow” becomes “JOEBL~1”. I think my utility is happy with that for its arguments. But I don’t know how to convert the path with spaces into that modified version. What is the algorithm for that conversion? Or is there a way to perform that conversion, using say FolderItem?