Symptom

Customer wished to determine the full server path to a mapped network drive

Environment

  • Microsoft Windows 7 x64
  • PowerBuilder

Resolution

The following steps allow you to determine the path for a mapped network drive from within a PowerBuilder application:

  1. The full path of a mapped drive is stored in the registry. Let us take M: as an example drive.
  2. Run regedit and go to HKEY_CURRENT_USER\Network
  3. Look for RemotePath under M entry which is the full path to the mapped network drive:

  1. This value can be retrieved in a PowerBuilder application using the following Powescript:
    string ls_mapped_drive = "M"
    string ls_remotepath
    RegistryGet("HKEY_CURRENT_USER\Network\" + ls_mapped_drive, "RemotePath", RegString!, ls_remotepath)
    where ls_remotepath will contain the remotepath to the drive.
  • Up
    1
  • Down
    0