Using shell() on Windows With UNC Paths
When using the shell() function in Revolution on Windows to call a command line executable, cmd.exe will complain if the defaultFolder is a UNC path. This can occur in the following scenario:
1) Launch a Revolution application from a shared network folder.
2) Use shell() to call a command line executable.
This lesson will show you how to avoid said error message in the result.
When you launch a Revolution application the defaultFolder property is set to the folder containing the application. When you call shell() the defaultFolder is used as the starting directory. If the defaultFolder is a UNC path then cmd.exe on Windows XP (Vista doesn't seem to care) will complain.
This dialog shows 'the result' of calling a command line executable through shell() when the defaultFolder is set to a UNC path.
To avoid this error simply set the defaultFolder to a local path (i.e. C:\) before calling shell(). You probably want to restore the defaultFolder to the previous value after calling shell().
This script demonstrates how to recreate the problem for testing purposes. Notice that in (1) the defaultFolder is set to a UNC path. This code created the dialog shown in the previous step.
If the code is changed so that the defaultFolder is "C:\" then no error appears in theCmdResult (2).