Source language: Translate to:

Rename

General questions about NeoBook

Moderator: Neosoft Support

Rename

Postby StarterPack » Mon Apr 03, 2017 2:34 am

Hi Guys.... I'm busy with a project where i copy a file (picture.jpg) into another Folder
How do I rename the picture with script?
Thank You!!!
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am

Re: Rename

Postby Gaev » Mon Apr 03, 2017 5:11 am

StarterPack:

i copy a file (picture.jpg) into another Folder
How do I rename the picture with script?

There is no FileRename command in NeoBook ... but you can use the second parameter in the FileCopy command to give your destination file another name ... from the Help file ...
FileCopy

Purpose:
Copy an external file.

Category:
Files

Syntax:
FileCopy "source file" "destination"

source file
The name of an existing external file on the reader’s computer.

destination
The drive and folder on the reader’s computer where the copied file is to be saved. You may optionally include a file name as part of the destination to save the copied file under a different name.


If you want to rename an existing file, you can ...

1) either do a FileCopy (like above, using the renamed file name as your destination) ... followed by a FileErase command on the source file

2) or use the Run command to request a DOS command (Rename).
User avatar
Gaev
 
Posts: 3716
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Re: Rename

Postby StarterPack » Mon Apr 03, 2017 8:47 am

Hi Gaev

THANK YOU AGAIN!!! The First One Is Exactly What I Need........ :mrgreen:
StarterPack
 
Posts: 115
Joined: Fri Feb 19, 2016 6:55 am

Re: Rename

Postby dpayer » Mon Apr 03, 2017 9:39 am

StarterPack wrote:Hi Guys.... I'm busy with a project where i copy a file (picture.jpg) into another Folder
How do I rename the picture with script?
Thank You!!!



Here are some VBS functions you can use to do this as well:

http://www.neosoftware.com/community/vi ... hp?t=19558

Copy the relevant parts, save in your functions folder with desired name and then "CALL" them in your NB script.
David Payer
Des Moines, Iowa
USA
User avatar
dpayer
 
Posts: 1380
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA


Return to General NeoBook Discussions

Who is online

Users browsing this forum: No registered users and 1 guest