/build/static/layout/Breadcrumb_cap_w.png

Is Folder shared or not?

Hi everone,

I need to check whether a folder shared or not by using Wise Script

Any one have any idea how to do that ?

I have tried like this but i encountered in erros
Calling SHGetFileInfo() function located in Shell32.dll

item: Set Variable
Variable=SHAREFOLDER
Value=C:\Program Files\Calman4\Satellite
end
item: Call DLL Function
Pathname=%SYS32%\shell32.dll
Function Name=SHGetFileInfo
Argument List=90  SHAREFOLDER
Argument List=210
Argument List=s0HICON
Argument List=²0IICON
Argument List=³0DWATTRIBUTES
Argument List=¹0ÑÿSZDISPLAYNAME
Argument List=¹0ÑÿSZTYPENAME
Argument List=33
Argument List=31800
Return Variable=3
Flags=00100000
end
item: Display Message
Title=value
Text=%DWATTRIBUTES%
end

0 Comments   [ + ] Show comments

Answers (5)

Posted by: anonymous_9363 14 years ago
Red Belt
0
Why would anyone in their right mind use WiseScript for that job, when there are so many examples around in other, more accessible languages?

Find a VBScript which lists all shares. You can then loop through the list, looking for a match to the folder in question. If you need to have an EXE (the only reason I can think of that you would want to use WiseScript) there are innumerable utilities around which will create an EXE from a VBS.
Posted by: joseph 14 years ago
Orange Belt
0
Hi,

why cant you go for vbscript for the same. here is one example...

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colShares = objWMIService.ExecQuery("Select * from Win32_Share")
For each objShare in colShares
t=objShare.Name
Wscript.Echo t
if t = "Shared folder caption or name" Then
Wscript.Echo "Given folder is shared"
exit for
End if
Next


Thanks,
R.Joseph.
Posted by: acbabu 14 years ago
Orange Belt
0
Thanks for the reply and suggestions

why iam going for wise script is iam using wise for my wrapper installation

so I need to check for the folde share if it shared i need to do some more tasks.
I dont know how to do that from VBscript

Vbscab if you can help me giving some idea i will be thankfull to you.
Posted by: acbabu 14 years ago
Orange Belt
0
More specifically i need to loop through it and if the folder is shared then i need to task kill a process
thats what i need to do.
Iam zero at VbScript ...
Posted by: acbabu 14 years ago
Orange Belt
0
I got it guys...

Thanks for the Help anyway
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ