BatchPatch Forums Home › Forums › BatchPatch Support Forum › Trouble with rename file via remote process/command
- This topic has 5 replies, 2 voices, and was last updated 8 years, 11 months ago by netman86.
-
AuthorPosts
-
January 13, 2016 at 4:07 pm #9140netman86Participant
Hello!
I’m evaluating BatchPatch for the ability to execute scripts before and after applying windows updates for the purposes of patching servers running in-house software that doesn’t want to be interrupted by reboots.
I’m having some trouble with basic functionality, however.
I’ve created “Remote command 1” and entered the following:
ren D:pathtofilefilename.txt BatchPatch_filename.txt
When I execute Remote Command 1, the “all messages” section shows this:
Wed-10:55:24> Remote Command: Exit Code: 2
Wed-10:55:24> Remote Command: Executing \$remoteserver -u $mydomain$myusername -p *password* ren D:pathtofilefilename.txt BatchPatch_filename.txt
Wed-10:55:23> Remote Command: Establishing connection…
Wed-10:55:23> Remote Command 1: Queued…
Now, I believe that error code 2 is a “cannot find file” error, but if I copy and paste the command from Remote Command 1 into a cmd shell on $remoteserver, it works fine.
What am I missing?
January 13, 2016 at 4:44 pm #11019netman86ParticipantAn interesting addendum, if I run the same commands with the Logged Output mode, they work fine.
Unfortunately, if I try and put these into a job queue, it still fails.
January 13, 2016 at 5:52 pm #9717netman86ParticipantI now see I can do a (logged output) version and will recreate my tasks this way. Still curious though 🙂
January 13, 2016 at 6:06 pm #9718dougModeratorREN is an internal MS-DS command, as opposed to a stand-alone executable. It can only be run inside of a cmd shell. When you execute ‘Remote Process/Command’ in BatchPatch, under the hood we actually do not load the cmd shell, so REN fails because there is no REN.exe to be found. However, in the case of ‘Remote Process/Command (Logged Output)’ we do load the cmd shell. This is why REN is successful in that case.
I hope this helps.
-Doug
January 13, 2016 at 8:17 pm #9719netman86ParticipantThank you! That makes perfect sense.
I’m polishing up my set of scripts and testing them one server at a time- once I get a working process down I’ll be trying four servers from each cluster to make sure it works everywhere before requesting a license.
Loving this application, thanks for the hard work- and thank you for making the evaluation useful so I can actually make sure it does what I need!
January 13, 2016 at 8:25 pm #9720dougModeratorThat sounds like a solid plan. I’m really glad to hear that you’re loving the app and that you find the evaluation version so useful! Thanks for the feedback. We really appreciate it.
-Doug
-
AuthorPosts
- You must be logged in to reply to this topic.