Jump to content

Detect multiple files or folders selected on file explorer


Recommended Posts

Hello
I have a query please
It is about windows file explorer
If i design a tool in autoit language to delete files for example
and i  added it in the context menu in File Explorer
If i right-click on any file And you choose the tool, it will be get the path of the selected file or folder
The problem here is
If i select a set of files or folders
it only detect the first one
The code that i  used is

if $CMDLine[0] = 0 then
msgBox(16, "error", "you don't selecte any files")
exit
else
for $i = 1 to $CMDLine[0]
msgBox(0, "files", $CMDLine[$i]
next
endIf
exit

Link to comment
Share on other sites

@nacerbaaziz

When posting code, use the code tag (<>) in the format bar.  It makes it much easier to read and provides links to the help file for recognized commands.

if $CMDLine[0] = 0 then
    msgBox(16, "error", "you don't selecte any files")
    exit
else
    for $i = 1 to $CMDLine[0]
        msgBox(0, "files", $CMDLine[$i]
    next
endIf
exit

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...