I have a bat file that starts a service, and it's scheduled in the Task Scheduler. I used the psexec command for that. I want to add another trigger based on the event, the event being completion of the "start the service" (aforementioned) to create a .txt file on a remote server or the local server whichever is possible.
Asked
Active
Viewed 4,183 times
2 Answers
3
By default a file created in c:\Windows\System32\ (Windows 10)
Set full path to file in a batch file, for example
echo > c:\temp\myfilename.txt
Or set the path in a "Start in (optional)" field on "Actions" tab of task properties in Task Scheduler.

opo
- 31
- 2
0
Writing a text file out with a batch script is as easy as echo'ing it out.
echo > myfilename.txt

Peter Mortensen
- 30,738
- 21
- 105
- 131

BReal14
- 1,603
- 1
- 12
- 35
-
Thanks Jordan briansol, I have to open a new .txt file and rename it as sometest.bat file and in it paste echo > myfilename.txt. Once done click on the bat file to execute it and create the file myfilename.txt, is that correct? – user1768709 Jun 30 '15 at 19:30
-
yup, that should work, assuming the executor user id has write permissions to that folder. – BReal14 Jun 30 '15 at 19:47
-
Thanks all for the suggestions – user1768709 Jul 06 '15 at 13:36