ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Coding Snacks

List of folders to be copied automatically

(1/1)

KoenFugro:
Hi people,

I have in MS Excel a list of folders, some empty, some not, that needs to be copied to another folder, eg s:\temp
The list of files aere in column A of excel, containing a complete path.

Is there a way that I can do this without user interaction?
I also have an Excel sheet with files that needs to be deleted, but I cannot change this in order to work...
Can someone help me on this one?

Thanks in advance!
Koen Franssen

AndyM:
This is not too difficult to do with a macro (VBA code) right from Excel.  You'd loop thru the list, doing a copy at each pass thru the loop.

KoenFugro:
Yes I know that...
But I am really not good in programming...

The code I use for deleting files is also a makro..
But how do I make a makro that does what I want?

KoenFugro:
Is there really nobody that can help me on this?

skrommel:
 :) Here's a quick AutoHotkey script.

Change the two first lines of the script. Also, the Excel can only contain one column.

Skrommel


--- ---excelfile=Files.xls
target=C:\Target\

#SingleInstance,Force
SendMode,Input
SetTitleMatchMode,2

Run,%excelfile%
WinWait,Excel
WinActivate,Excel
WinWaitActive,Excel
Sleep,1000
Send,^{Home}
Sleep,1000
Send,^+{End}
Sleep,1000
Send,^c
Sleep,1000
StringSplit,file_,Clipboard,`n
WinClose,Excel

Loop,%file_0%
{
  file:=file_%A_Index%
  MsgBox,%file%
  If file<>
    FileMove,%file%,%target%
}

Navigation

[0] Message Index

Go to full version