Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to find share name of a disk programmatically?
Message
From
14/04/2004 00:22:05
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
13/04/2004 19:57:00
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00894627
Message ID:
00894664
Views:
7
>In order to create a simple to use backup program for SQL data, I'd like to pass the SQL Server (SQLDMO.Backup) the name of a directory in the calling computer where the backup file should go. This should be in the form \\MachineName\DiskShareName\DirName.
>
>I pressume that GETENV('COMPUTERNAME') will return the machine name.
>How can I get the share name of a disk programmatically? Bear in mind that in our case it is usually changed and not "C".
>
>Thanks you very much.

If using file system object is not an option, you can always
run net use >netuse.txt
lcUsed=filetostr("netuse.txt")
Of course, the more elegant way would be to use late Ed Rauh's API_APPRUN class instead of the run command, so you don't get pathing problems (are you really sure in which directory will the run command run?) and the ugly black window while it runs.

And then just parse the string.

Hey, I didn't say it was easy :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform