Archive: How to check to see if folder is shared.


How to check to see if folder is shared.
Hi,

I know how to use:
nsExec::Exec 'net share myfolder=$ccPath'

to set myfolder to share, but is there a way to check to see if it is already shared?

Thanks. I am having great fun with NSIS!!

John


u could call NetShareEnum with the system plugin (there are differences between 9x and nt)


Here's another possibility that I should work consistantly in the different versions of windows. (This is assuming that the output remains consistant with the different versions of Windows)

 nsExec::ExecToStack 'Net Share' 

Then, you could create a function that takes the output off the top of the stack to find out the folders that are currently shared.

I did a quick test and I can get the output OK, so at least in theory, it should work. (Just don't forget that the top of the stack will be the return value. The 2nd item on the stack will be the actual output.)