I'm executing a batch file from the Command Scheduler (on server1) which executes ok until I add file piping. The batch file resides on server2, but it executes on server1.
The batch file maps a network drive and then sends ECHO command output to a file in the current directory. The commands used are:
net use y: \\my_server\share
ECHO ***** Start of TEST BATCH FILE Processing. ***** >test.log
ECHO | MORE | DATE | FIND "date is" >>test.log
Test.log is to be created in the \\my_server\share\folder1\folder2\folder3 directory. Everything was ok until I added the piping for logging purposes. Now I have a mapped network drive that I can't get rid of. It shows up in Explorer and at the command prompt. The drive letter is available both places, but I can't delete it from Explorer or at the command promt. NT says that the driver letter isn't available when I use 'net use y: /delete'.
My first question is "How can I get the piping in the batch file to work properly?"
And my second question is "How can I easily get rid of the 'phantom' driver mappings?" (I'd like to avoid rebooting as this is an in-use server.)