AutoHotkey Community

It is currently May 27th, 2012, 6:12 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: December 2nd, 2005, 10:44 pm 
Is there a way to replicate the way explorer renames files if they already exist?

ive noticed back in the napster days, when you download a file, if it already exists, then it would rename it with a (1). i.e. test.txt, test(1).txt, test(2).txt.

how can I replicate this? I am just moving files from one folder to another.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2005, 11:00 pm 
Offline

Joined: December 1st, 2005, 7:04 pm
Posts: 37
Location: Los Angeles, CA
are you moving files in explorer? or are you looking for a script that does the moving and renames the files accordingly?

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 2nd, 2005, 11:08 pm 
i am actually copying a txt file from the floppydrive to my c drive. not in explorer, from a script.

Code:
filecopy/move, A:\test.txt, C:\test.txt


I have a bunch of floppies, all with the same file/filename, but different contents, so i do not want to overwrite, but i dont want it to NOT move/copy.

The help files say that errorlevel is set to the number of files that could be copied cause of overwrite. The files do not get moved. I want the files to be moved regardless, but not overwritten.

I hope this makes sense...it seems that this should be a simple process...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 3rd, 2005, 12:17 am 
Offline

Joined: December 1st, 2005, 7:04 pm
Posts: 37
Location: Los Angeles, CA
haven't tested it - but this should take care of what you need... hope it works out

Code:
filecopy/move, A:\test.txt, C:\test.txt
if errorlevel = 0
return
else
loop
{
filecopy/move, A:\test.txt, C:\test(%a_index%).txt
if errorlevel =0
break
}
return

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 3rd, 2005, 12:24 am 
wow!...i dont know why i cant figure this kinds of things out. Thanks Jesse; youve been big help. Works well.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 3rd, 2005, 12:26 am 
Offline

Joined: December 1st, 2005, 7:04 pm
Posts: 37
Location: Los Angeles, CA
no problem man

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Google Feedfetcher, HotkeyStick, Wicked and 56 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group