I do actually use " around the share ("\\server\share"), but it seems to work fine with or with out it. Sorry I didn't show that in my original message. It's when I add the /delete line in that doesn't seem to work. Like I said, it does work just fine in debug mode (with no persistent switch), which steps it through one by one.

I also am testing this locally, so no DC's to worry about.

I can have just one line in the middle of the if statement, and either the delete or mapping works fine, it's just they won't work together.

Hope that info helps, and thanks for all your help with this so far!