VoxCommando

New Features and Feature Requests => Feature Requests => Topic started by: PegLegTV on March 14, 2017, 01:44:42 PM

Title: file.move with overwrite boolean
Post by: PegLegTV on March 14, 2017, 01:44:42 PM
would it be possible to add a Boolean to File.Move for overwrite option, I'm working on a few commands that would be simpler if it could just overwrite the file, as of now I'm having to use either file.Delete or File.GetFiles and File.Delete.

Thanks  :)
Title: Re: file.move with overwrite boolean
Post by: jitterjames on March 14, 2017, 01:56:38 PM
Why is using File.Delete first a problem?
Title: Re: file.move with overwrite boolean
Post by: nime5ter on March 14, 2017, 02:12:08 PM
Have you tried Launch.CMD? I think the following is working in the way you describe -- moving a file and overwriting a file of the same name if it exists at the destination path. (I haven't rigorously tested this -- just once with a text file.)

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.3.5-->
<command id="69" name="move and overwrite file" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Launch.CMD</cmdType>
    <params>
      <param>MOVE /Y "yourfile_sourcepath" "yourfile_destinationpath"</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>move and overwrite file</phrase>
</command>
Title: Re: file.move with overwrite boolean
Post by: PegLegTV on March 14, 2017, 02:21:26 PM
Why is using File.Delete first a problem?
it's not really a problem, I was thinking that having the Boolean for overwrite could make the command simpler (less actions), I was thinking with my lazy brain  :)


Quote
Have you tried Launch.CMD? I think the following is working in the way you describe -- moving a file and overwriting a file of the same name if it exists at the destination path. (I haven't rigorously tested this -- just once with a text file.)
Thanks I'll give it ago and see how it works

keep up the great work  8)