Jump to content

Folders on a shared computer?


Recommended Posts

I was wondering if anyone had any ideas why the first one fails, but the second doesn't?? Am I missing something?

$server = "\\Computer"
$search = FileFindFirstFile ($server & "\*.*")
MsgBox (0, $search, @error)

$search = FileFindFirstFile ($Server & "\shared folder\*.*")
MsgBox (0, $search, @error)

Typo in code.

Is there any better way to get shared folders from a computer?

Edited by Bert
Link to comment
Share on other sites

To me it looks like a Security Policy issue on the "server" computer.

Try auditing some of the settings for the shared drive on the server, opening more permissions for people who connect to it.

I am just testing on my own computer. If I need a password to access to it I just run the following, which gains me access.

If $search = -1 Then
    If $domain <> "" Then
        $sdout = Run("net use " & $server & " /USER:" & $domain & "\" & $username & " " & $password, @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    Else
        $sdout = Run("net use " & $server & " /USER:" & $username & " " & $password, @SystemDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
    EndIf

While 1
    $line = StdoutRead($sdout)
    If @error Then ExitLoop
    ConsoleWrite (">> STDOUT read:" & $line & @CRLF)
Wend

While 1
    $line = StderrRead($sdout)
    If @error Then ExitLoop
    ConsoleWrite (">> STDERR read:" & $line & @CRLF)
Wend
ConsoleWrite (">> STD read complete"& @CRLF)
EndIf

EDIT: The folder in the root is the only one. I can access just that folder as with the second example. Its just not working with the root.

Edited by Bert
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...