Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vbscript VBS回显共享存在于远程共享路径_Vbscript_Share_Wsh - Fatal编程技术网

Vbscript VBS回显共享存在于远程共享路径

Vbscript VBS回显共享存在于远程共享路径,vbscript,share,wsh,Vbscript,Share,Wsh,我有一个vbs脚本,它列出了存在Windows共享的路径。如果网络共享(路径)存在,我将如何选择路径和回显?我想我需要使用Network对象来查看share path=true,但我不知道怎么做 有什么帮助吗 Dim objNetwork, strUserName, strNetworkPathFolder, strRevBackupServerPath, Set objNetwork = CreateObject("WScript.Network") strRevBackupServerP

我有一个vbs脚本,它列出了存在Windows共享的路径。如果网络共享(路径)存在,我将如何选择路径和回显?我想我需要使用Network对象来查看share path=true,但我不知道怎么做

有什么帮助吗

Dim objNetwork, strUserName, strNetworkPathFolder, strRevBackupServerPath,

Set objNetwork = CreateObject("WScript.Network")

strRevBackupServerPath="\\SERVER\"

strNetworkPathFolder="BackupPC_RevisonFileBackup$"

If  strRevBackupServerPath&strNetworkPathFolder = true then 
 WScript.Echo "Share Exists" 
Else
 WScript.Echo "Share Does Not Exists" 
End If
'We don't need the WshNetwork object, it doesn't
'have any methods that are useful for your case.
'You also have strUserName and an extra comma at
'the end of your declarations.
Dim objFSO, strRevBackupServerPath, strNetworkPathFolder

'This is the filesystem object, we'll be using the
'FolderExists method.
Set objFSO = CreateObject("Scripting.FileSystemObject")

'Here we use the FolderExists method to determine
'if the folder exists. Since the method returns
'a boolen true or false, we don't have to compare
'it to anything, it's evaluation is implicit.
If  objFSO.FolderExists(strRevBackupServerPath & strNetworkPathFolder) Then
  Wscript.Echo "Share Exists"
Else
  WScript.Echo "Share Does Not Exist" 
End If