Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Get Server Name
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00456426
Message ID:
00457058
Views:
30
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform