How to copy a file to, rename and then open...

Get help with using AutoHotkey and its commands and hotkeys
omar
Posts: 424
Joined: 22 Oct 2015, 17:56

How to copy a file to, rename and then open...

04 Sep 2020, 10:33

I want to copy a file... copy it to another folder.
I want to give it a name of the current date and time (including seconds)...

I then want to open the file.
The file will either be a Word or Powerpoint file.

I wasn't sure where to start.
Use DOS to do the copying or AHK?
Pausing and allowing actions... how do I determine how much?

Thanks.
garry
Posts: 2431
Joined: 22 Dec 2013, 12:50

Re: How to copy a file to, rename and then open...

04 Sep 2020, 11:00

a basic example

Code: Select all

F1   = c:\test\testsub.txt
dest = %a_desktop%\TEST
ifnotexist,%dest%
  filecreatedir,%dest%
SplitPath,F1, name, dir, ext, name_no_ext, drive
new=%dest%\%name_no_ext%_%a_now%.%ext%
filecopy,%f1%,%new%
try
 run,%new%
exitapp
omar
Posts: 424
Joined: 22 Oct 2015, 17:56

Re: How to copy a file to, rename and then open...

04 Sep 2020, 11:20

@garry very nice. Thanks.
I assumed I would need a few sleeps inbetween commands
I'll let you know if I have troubles

Return to “Ask For Help”

Who is online

Users browsing this forum: Albireo, Bing [Bot], RubbeH, songdg and 63 guests