0
I want to schedule a batch file to execute a command and redirect that output a text file.
This is my current solution:
Del \\10.112.232.10\Netbackup_Softwares\Personal\Bharath\VM_Query\switch.txt
D:\VMware_Query\VM_Query.bat >> \\10.112.232.10\Netbackup_Softwares\Personal\Bharath\VM_Query\switch.txt
Windows Server 2012
When I tried with task scheduler its executing the command but not redirecting output to text file.
Command works fine when I execute from cmd prompt.
can someone help me with this. – user3016638 – 2016-05-12T07:01:43.510
Can you post the logic which is in your batch file VM_Query.bat? I would put the
<< %logfilename%
in that file and just have the schedule pass the UNC full pass as an argument and then delete if exist and all the rest. Post the batch logic from your file to an edit on your answer and I will show you how to EASILY get this to work and provide an answer with a precise example I test and confirm to work just as you describe. – Pimp Juice IT – 2016-05-14T14:12:34.110