Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: error mapping drive ('\\')

by tye (Sage)
on Jan 11, 2007 at 21:42 UTC ( [id://594240]=note: print w/replies, xml ) Need Help??


in reply to error mapping drive

'\\PC11659­7\print' is the same as '\PC116597\print' or '\\PC116597\\print'. I suggest you use '\\\\PC116597\\print'. I think that relying on the fact that '\p' gets translated into the same thing as '\\p' is just the thing that leads to this type of mistake.

Update: And including $strDrive and $strPath in your error message would have shown you the problem immediately, so you might want to reinforce that habit.

- tye        

Replies are listed 'Best First'.
Re^2: error mapping drive ('\\')
by djbryson (Beadle) on Jan 11, 2007 at 22:02 UTC
    funny, i tried \\\\PC116597\\print already and it didn't work, but it works now. I must have had something else wrong. I figured the single quotes would handle it. You're right, i should have outputted the path var. Well, it's successfully mapping the drive, but for some reason my error still comes true. This line:
    $objNetwork->MapNetworkDrive($strDrive, $strPath) || print "failed ma +pping $strPath\n";
    It still prints failed even though it worked... hmmm Thanks for your help!
      It still prints failed even though it worked

      WSH-methods which don't return some other "object", more often then not return nothing at all. So you can't check for a success/failure return value as in $obj->method() || die; with those methods.

      From your observation this seems to be the case here, too.

        That's what i thought. Thanks for your help monks!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://594240]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2025-03-21 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When you first encountered Perl, which feature amazed you the most?










    Results (63 votes). Check out past polls.