Jump to content

Q: Failsafe 'net Use /delete' Command?


Recommended Posts

Guest phkappler

I do map some shares to drive letters within an AutoIt script utilizing the 'net use' command. This works flawless. However, I'm experiencing difficulties when trying to delete those mappings. In some cases, I get an error message that there are open files:

X:\>net use p: /delete
Entweder sind Dateien geƶffnet, oder die Suche in den Verzeichnissen auf p:
ist noch nicht abgeschlossen.

Soll die Verbindung getrennt werden? (J/N) [N]:

This message would need "j{ENTER}" to close. However, I can't do any error handling because the script waits for the RunWait command to terminate. To use Run isn't a way either because the mapping is timing-critical and the number of seconds needed varies depending on the single PC and its position in our network.

Is there any fail-safe 'net use /delete'-like command? Has anyone written a piece of code already? Any hints?

Thanks for your time and your ideas.

Best regards,

Philipp

Link to post
Share on other sites
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...