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

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

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.
Answered 05/11/2010 by: VBScab
Red Belt

Please log in to comment
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.
Answered 05/11/2010 by: joseph
Orange Belt

Please log in to comment
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.
Answered 05/11/2010 by: acbabu
Orange Belt

Please log in to comment
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 ...
Answered 05/11/2010 by: acbabu
Orange Belt

Please log in to comment
0
I got it guys...

Thanks for the Help anyway
Answered 05/11/2010 by: acbabu
Orange Belt

Please log in to comment
Answer this question or Comment on this question for clarity