<div dir="ltr"><div dir="ltr"><div>Public Sub btnMoveKill_Click()</div><div> Dim sSourcePath, sDestinationPath, sFilename As String</div><div><br></div><div> sSourcePath = User.Home &/ "DW"</div><div> sDestinationPath = User.Home &/ "GB3BUCH"</div><div> sFileName = "dokuwiki_syntax.txt"</div><div><br></div><div>' Check whether the file to be moved exists.</div><div> If Exist(sSourcePath &/ sFileName) Then </div><div> Message.Error("File not exist: " & sFileName)</div><div> Return</div><div> Endif</div><div> </div><div> Move sSourcePath &/ sFileName Kill sDestinationPath &/ sFileName</div><div> </div><div> Message.Info("File '" & sFileName & "' successfully moved!")</div><div><br></div><div>End</div><div><br></div><div><br></div><div>Public Sub btnMoveKill_Click()</div><div>Dim sSourcePath, sDestinationPath, sFilename As String</div><div><br></div><div> sSourcePath = User.Home &/ "DW"</div><div> sDestinationPath = User.Home &/ "GB3BUCH"</div><div> sFileName = "dokuwiki_syntax.txt"</div><div><br></div><div>' Check whether the file to be moved exists.</div><div> </div><div> Move sSourcePath &/ sFileName Kill sDestinationPath &/ sFileName</div><div> Message.Info("File '" & sFileName & "' successfully moved!")</div><div> </div><div>Catch </div><div> Message.Error(Error.Text)</div><div>End</div><div><br></div><div><br></div><div>i think the second way can do the job too but i've not tested it yet</div></div></div><br><div class="gmail_quote"><div dir="ltr">Le dim. 23 sept. 2018 16:35, Hans Lehmann <<a href="mailto:hans@gambas-buch.de" target="_blank">hans@gambas-buch.de</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Fabien,<br>
<br>
thank you so much for your answer.<br>
Here is the modified and verified source code:<br>
<br>
Public Sub btnMoveKill_Click()<br>
<br>
Dim sSourcePath, sDestinationPath, sFilename As String<br>
<br>
sSourcePath = User.Home &/ "DW"<br>
sDestinationPath = User.Home &/ "GB3BUCH"<br>
sFileName = "dokuwiki_syntax.txt"<br>
<br>
' Check whether the file to be moved exists.<br>
If Exist(sSourcePath &/ sFileName) Then<br>
' Now check if moveto directory exists<br>
If Not Exist(sDestinationPath) Then<br>
Try Mkdir sDestinationPath<br>
If Error Then<br>
Message.Error("Error! " & Error.Text)<br>
Return<br>
Endif<br>
Endif<br>
' Now the file is moved<br>
Move sSourcePath &/ sFileName Kill sDestinationPath &/ sFileName<br>
Else<br>
Message.Error("File not exist: " & sFileName)<br>
Return<br>
Endif<br>
<br>
Message.Info("File '" & sFileName & "' successfully moved!")<br>
<br>
End<br>
<br>
Hans<br>
<br>
----[ Gambas mailing-list is hosted by <a href="https://www.hostsharing.net" rel="noreferrer noreferrer" target="_blank">https://www.hostsharing.net</a> ]----<br>
</blockquote></div>