Source language: Translate to:

Rename a Folder

Post your suggestions for future versions of NeoBook

Moderator: Neosoft Support

Rename a Folder

Postby datadon » Mon Jun 18, 2007 2:30 pm

I know there is a plugin on this, but I would love to see a standard NB action that would rename a folder.

RenameFolder "Path of Source Folder" "New folder name"

Thanks
Don
Don

'If you want to get a brontosaurus from 'a' to 'b' then you ride the dinosaur - you don't carry it!'
User avatar
datadon
 
Posts: 389
Joined: Sun Apr 03, 2005 7:55 pm
Location: Lorena Texas

Re: Rename a Folder

Postby dpayer » Tue Jun 19, 2007 12:53 pm

datadon wrote:I know there is a plugin on this, but I would love to see a standard NB action that would rename a folder.

RenameFolder "Path of Source Folder" "New folder name"

Thanks
Don


The DOS command works for folders too:

example:
ren c:\temp\temp c:\temp\temp1


David P
User avatar
dpayer
 
Posts: 1383
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby Gaev » Tue Jun 19, 2007 1:36 pm

DavidP:
The DOS command works for folders too:

example:
ren c:\temp\temp c:\temp\temp1

In spite of some confusing help information about this command ...
C:\>help ren
Renames a file or files.

RENAME [drive:][path]filename1 filename2.
REN [drive:][path]filename1 filename2.

Note that you cannot specify a new drive or path for your destination file.

... it actually works on folders ... this was the first solution that came to mind ... but was put off by the help info ... searched Google ... and none of the half a dozen utils did the job as simply as this powerful command ... thanks for bringing it to our attention.
User avatar
Gaev
 
Posts: 3734
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada

Postby dpayer » Tue Jun 19, 2007 1:53 pm

Gaev wrote:
Note that you cannot specify a new drive or path for your destination file.


If we were specifying a new drive or path, it would need to be a copy or move command. Renaming implies the item is static.

D
User avatar
dpayer
 
Posts: 1383
Joined: Mon Apr 11, 2005 5:55 am
Location: Iowa - USA

Postby TechMedia » Tue Jun 19, 2007 3:58 pm

I just want to know how to retrieve error messages with this technique, because renaming folders can failed for N reasons.
TechMedia
 

Postby Gaev » Tue Jun 19, 2007 4:40 pm

If we were specifying a new drive or path, it would need to be a copy or move command. Renaming implies the item is static.

I get the part about a new drive ... the confusion (on my part) was the "path" bit ... in my mind "parent\child" is a path ... I guess true definition is "c:\parent\child" ... also the description refering to "file or files" and no mention of "folders".
I just want to know how to retrieve error messages with this technique, because renaming folders can failed for N reasons.
Since something like ...
Code: Select all
C:\>rename gktest2 gktest > c:\renameError.txt

... does not work, best way is to check for the existence of ...

- the "to be renamed folder" BEFORE the rename action
- a known file in the "renamed folder" AFTER the rename action


OR

Use AutoIt's FileExists ( "path" ) command ... works on both files and folders ... before and after the rename

Talking about AutoIt ... it has a DirMove ( "source dir", "dest dir" [, flag] ) command which is very versatile ... will copy files if on another drive ... include all subfolders in the source folder ... and the flag can be used to specify if "existing files can be overwritten.
User avatar
Gaev
 
Posts: 3734
Joined: Fri Apr 01, 2005 7:48 am
Location: Toronto, Canada


Return to NeoBook Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest