{"id":1826,"date":"2021-10-26T12:22:03","date_gmt":"2021-10-26T12:22:03","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=1826"},"modified":"2021-10-26T12:22:47","modified_gmt":"2021-10-26T12:22:47","slug":"solved-psexec-to-run-exe-on-remote-client-and-log-results","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/psexec-to-run-exe-on-remote-client-and-log-results\/28423.html","title":{"rendered":"Solved PSEXEC To Run .exe On Remote Client And Log Results"},"content":{"rendered":"<p>I am using psexec to run an .exe that is stored in a directory called &#8220;temp&#8221; on a remote computer. After the .exe is finished executing a results log file is created in another direcotry called &#8220;logs&#8221;. What I want happen is to have a new log file generated each time a run the script. I would like the log file to contain the current date, computer name and time that the script was ran.<\/p>\n<p>I am running something like this currently:<\/p>\n<p>psexec \\\\client-01 c:\/temp\/execute.exe \/q<br \/>\necho %date%, %computername%, %time% &gt;&gt; Logs\/results.log 2&gt;&amp;1<\/p>\n<p>When I run this script I get the following output:<\/p>\n<p>date, computername, time&#8230;&#8230;that is it&#8230;&#8230;&#8230;..<\/p>\n<p>Shouldn&#8217;t I get a message that says the the .exe exited on the client with error code whatever?<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":4},"question-category":[55],"question_tags":[],"class_list":["post-1826","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/1826","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=1826"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=1826"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=1826"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=1826"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}