[python-win32] Re: how to know the native file path of computer A

Roger Upole rwupole at msn.com
Wed Mar 22 02:08:07 CET 2006


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



More information about the Python-win32 mailing list