Hi, Roger Thank you very much for your suggestions. Finally I solved my problems based on your suggestions.
Here is what I did: in client side, I use WNetEnumResource to get mapped share name, M:->\\server_computer\shared then I send "shared" to the remote(server) computer. in server(remote) side, I use win32net.NetShareEnum to compare "shared" and get the local path. I still have the same problem in a Windows/Linux mixed environment. Do you have any idea to get local path in linux from Windows' side ? Best regards. Michael Li Roger Upole wrote: > Michael Li wrote: > >>Hi, >>I got bunch of reply, thank you very much. >>But they are not what i want. >>Let me make it more clear, my code looks like: >> >> nRetCode = os.access(szFolder, os.F_OK) >> if nRetCode == 1: >> nRetCode = os.chdir(szFolder) >> szNormPath = os.path.normpath(szCommand) >> szBatchFile = szNormPath >> anArgs = [szBatchFile, 'NDEBUG'] >> nRetCode = os.spawnv(os.P_NOWAIT, szBatchFile, anArgs) >> >>The above code is on the computer A where python server >>is running. The szFolder must be "C:\shared\database", not >>"W:\database", because "W:" does not exist on computer A, >>"W:" is on computer B. >> >>Right now, szFolder comes from computer B as an argument inputed >>on computer B, I want to make szFolder auto-decide if possible. >>Any ideas ? >> > > > You can use win32net.NetUseGetInfo to find what network share > your local drive is mapped to, and then win32net.NetShareGetInfo > to get the local path on the remote machine. > > Roger > > _______________________________________________ > Python-win32 mailing list > Python-win32@python.org > http://mail.python.org/mailman/listinfo/python-win32 > ========== This email message and any attachments are for the sole use of the intended recipients and may contain proprietary and/or confidential information which may be privileged or otherwise protected from disclosure. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipients, please contact the sender by reply email and destroy the original message and any copies of the message as well as any attachments to the original message. _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32