Jump to content
Sign in to follow this  
BrettF

Folders on a shared computer?

Recommended Posts

BrettF

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

Share this post


Link to post
Share on other sites
Squirrely1

It looks like the first one won't work when the second one does work on your machine because of the type of connection you have to the other computer - you don't have enough permission.


Das Häschen benutzt Radar

Share this post


Link to post
Share on other sites
Dampe

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.


Share this post


Link to post
Share on other sites
BrettF

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

Share this post


Link to post
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
Sign in to follow this  

×