When I mapped a network drive to this machine, I found that the program was able to access the read network drive directly, but it could not be accessed when the native program was running as a native Windows service.
Qdir::exist (folder) access in Qt failed. This is caused by mapping the network drive, requiring the service program to run the rights account and the remote shared file for the machine to run in the same domain (domains)
Below, with Pstool This tool, it directly uses the System account permissions to map network drives. This allows the remote drive and native service to be in the same domain.
Note: this is a relatively hack approach and is not recommended. Microsoft is not supported.
1. Create a network drive with PsExec:
Admin permissions run cmd, and then run psexec-i-S Cmd.exe
Then run the following command in the newly opened CMD window to map the network drive Z-disk, net use Z: \\server_ip\share_folder/persistent:yes
The net command above may let you enter the remote system user name and password, my remote is XP, so the user name password is: administrator/no password
Note: all Microsoft Windows system default administrator users are administator and the password is set by yourself, the system does not have a default password
2. Running the native Windows service, successfully accessing the network drive Z
References
Http://stackoverflow.com/questions/18632193/directory-exists-returns-false-for-mapped-drive-in-c-sharp-coding
Http://stackoverflow.com/questions/3622089/windows-service-cant-access-network-share
Http://serverfault.com/questions/177139/windows-service-cant-access-network-share
Http://stackoverflow.com/questions/182750/map-a-network-drive-to-be-used-by-a-service
Https://technet.microsoft.com/en-us/sysinternals/psexec (pstool tool download)
Solutions for Windows service not accessing the network share drive