Guest phkappler Posted March 25, 2004 Share Posted March 25, 2004 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 comment Share on other sites More sharing options...
Guest phkappler Posted March 25, 2004 Share Posted March 25, 2004 I succeeded at last. A simple (while undocumented) /Y did the trick. Link to comment Share on other sites More sharing options...
ezzetabi Posted March 25, 2004 Share Posted March 25, 2004 /y do the trick in this case, but if you have the same problem with programs that do not have that possibility you can always try echo s|(command) Like echo s|format c: /u Link to comment Share on other sites More sharing options...
Recommended Posts