LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

programmatically Share a directory

Hi everyone,
I use CVI6.0 under Windows 2000 and I have a couple of questions I could not
solve :
First, I'm looking for a way to share a directory on the local drive.
I'd like to do it programmatically.
Is there a way I could do this? Is there a way to check wether some
directory is already shared or not?

Second, Is there a way to retreive the computer friendly name? I know that
GetTCPHostName resolves the name of the
computer, what I'd like to get, is the computer description (additional
comment you add to the computer name).

Best Regards,
Marco
0 Kudos
Message 1 of 3
(3,017 Views)
As per the first part of your question, I suggest you to take a look at the Windows SDK that ships with CVI: searching for the "Net" keyword you'll find a lot of commands and data structures to perform what you need; you'll find some sample code too. The NetShareAdd command for example is used to share a local resource.

A simpler way of doing it could be to issue a "net share" command with the appropriate parameters using system() or LaunchExecutable() command of CVI. In case you want to gather informations, you could redirect the output of the net command to a file and read back it. This is maybe not "politically correct" but it often works simpler than deeping into several dozens of help screens on SDK...

Hope this helps
Roberto


Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
Message 2 of 3
(3,017 Views)
Thank you Roberto,
I'll try both ways and go for the smartest one.
I apreciate your help.

Best Regards,
Marco

"Roberto Bozzolo" a écrit dans le message de
news:5065000000050000000C960100-1079395200000@exchange.ni.com...
> As per the first part of your question, I suggest you to take a look
> at the Windows SDK that ships with CVI: searching for the "Net"
> keyword you'll find a lot of commands and data structures to perform
> what you need; you'll find some sample code too. The NetShareAdd
> command for example is used to share a local resource.
>
> A simpler way of doing it could be to issue a "net share" command with
> the appropriate parameters using system() or LaunchExecutable()
> command of CVI. In case you want to gather informations, you co
uld
> redirect the output of the net command to a file and read back it.
> This is maybe not "politically correct" but it often works simpler
> than deeping into several dozens of help screens on SDK...
>
> Hope this helps
> Roberto
0 Kudos
Message 3 of 3
(3,017 Views)