Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Get Server Name
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00456426
Message ID:
00457058
Vues:
31
>What I meant to say was that the Calling .Exe and the Server.exe are stored on the same drive. The Calling .Exe is running on a local machine and the Server.exe is running on the server. However, the calling .exe needs to know the name of the server that Server.exe is registered on. Since the default dir for the calling .Exe is the same as the default dir for the Server.exe I need a function to get the ServerName (\\Jupiter in the example) so I do not have to hard code it.
>
>Thanks
>
>Dennis

You can use the FileSystemObject of the Windows Scripting Host.
ofso = createobject("scripting.filesystemobject")
lcdrive = left(sys(16,1),2)
odrive = ofso.GetDrive(lcdrive)
lnpos = at("\",oDrive.ShareName,3)
if lnpos > 0 then
	? left(oDrive.ShareName,lnpos-1)
endif
HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform