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
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)
Please log in to answer
Posted by:
anonymous_9363
14 years ago
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.
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
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.
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
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.
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
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.