Help with User Button (CTB1) to scan with my virus checker

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
trusted
Posts: 3
Joined: 16 Nov 2009 21:02

Help with User Button (CTB1) to scan with my virus checker

Post by trusted »

Hello this is my first time on these forums so please be gentle with me.
I have been playing around with a User Button trying to get it to scan selected files or folders with my ant-virus software.
I have set the On click: to read <openwith "D:\Program Files\Avira\AntiVir Desktop\avscan.exe">.
However this just gives a "Invalid Parameter" warning.

Can some kind person please help?
Best regards,
Alan.

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Help with User Button (CTB1) to scan with my virus checker

Post by zer0 »

Hello and welcome to XYplorer forums!

If I understand correctly, you have the following as the code for 'Click' event of the left mouse button:

Code: Select all

openwith "D:\Program Files\Avira\AntiVir Desktop\avscan.exe"
It's a logical approach, but not every program would support such direct methodology. A quick Google search revealed this Avira Knowledge Base article: http://www.avira.com/en/support/kbdetails.php?id=229.
Stemming from information in that article, I'd think that the correct code for your CTB would be:

Code: Select all

openwith """D:\Program Files\Avira\AntiVir Desktop\avscan.exe""  /PATH="<items>""; 
As I don't use Avira, you'd have to check the correctness yourself. My only concern is whether <items> in quotes would get resolved to what it should get resolved while still being in quotes as per Avira's requirement. Over to you :)
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

serendipity
Posts: 3360
Joined: 07 May 2007 18:14
Location: NJ/NY

Re: Help with User Button (CTB1) to scan with my virus checker

Post by serendipity »

trusted wrote:Hello this is my first time on these forums so please be gentle with me.
I have been playing around with a User Button trying to get it to scan selected files or folders with my ant-virus software.
I have set the On click: to read <openwith "D:\Program Files\Avira\AntiVir Desktop\avscan.exe">.
However this just gives a "Invalid Parameter" warning.

Can some kind person please help?
Best regards,
Alan.
Hi and Welcome,
I don't use AntiVir so I don't know, you have to figure out the syntax for the scan first. In AVG it is:

Code: Select all

avgscanx /scan=C:\;D:\
So in XY one can use either:

Code: Select all

run "avgscanx /scan=C:\";
or

Code: Select all

openwith """C:\Program Files\AVG\AVG9\avgscanx.exe"" /scan=C:\"
If you know for AntiVir then post it here and someone can help you.

jacky
XYwiki Master
Posts: 3106
Joined: 23 Aug 2005 22:25
Location: France
Contact:

Re: Help with User Button (CTB1) to scan with my virus checker

Post by jacky »

zer0 wrote:

Code: Select all

openwith """D:\Program Files\Avira\AntiVir Desktop\avscan.exe""  /PATH="<items>""; 
hmm I don't think that's right, as here you're ending the (quoted) parameter of openwith before <items>, if you wanted <items> to be quoted those should be double-quotes as well (followed by a third one in a row at the end, of course). Although IIRC that shouldn't be necessary, as <items> does already return a space-separated list of quoted items.
So, this should be enough:

Code: Select all

openwith """D:\Program Files\Avira\AntiVir Desktop\avscan.exe""  /PATH=<items>";
However it should be noted that the page zer0 linked to doesn't mention a list of items to be scanned, only the one path to a file or a folder, so it might not actually accept a list of items...
Proud XYplorer Fanatic

trusted
Posts: 3
Joined: 16 Nov 2009 21:02

Re: Help with User Button (CTB1) to scan with my virus checker

Post by trusted »

jacky wrote:
zer0 wrote:

Code: Select all

openwith """D:\Program Files\Avira\AntiVir Desktop\avscan.exe""  /PATH="<items>""; 
hmm I don't think that's right, as here you're ending the (quoted) parameter of openwith before <items>, if you wanted <items> to be quoted those should be double-quotes as well (followed by a third one in a row at the end, of course). Although IIRC that shouldn't be necessary, as <items> does already return a space-separated list of quoted items.
So, this should be enough:

Code: Select all

openwith """D:\Program Files\Avira\AntiVir Desktop\avscan.exe""  /PATH=<items>";
However it should be noted that the page zer0 linked to doesn't mention a list of items to be scanned, only the one path to a file or a folder, so it might not actually accept a list of items...
Thank you all for your help.

I did have some success with :

Code: Select all

openwith """D:\Program Files\Avira\AntiVir Desktop\avscan.exe""  /PATH=<items>";
but it scanned 225 Files including the single one I had highlighted. So I need a way of pointing the scan only at the files/folders I have highlighted.

Further reading on the Avira Support site said the following:-
AntiVir Scanner uses the configuration set in AntiVir, under Configuration - Scanner. So, if you activated the option Scan master boot sectors, they will be scanned every time avscan.exe starts.

In case you do not want to use this option, because the scanning takes longer, there is a work-around, for scanning only the selcted files.

Download this profile file (right-click the link and select Save link as): filescan.avp
Save the file on your hard disk, then right-click it and select Properties. Activate the option Read only and press OK.
Now you have to apply this profile to the /CFG parameter. For example, to use AntiVir with WinRAR, you have to use the following parameters:
Scanner name: "%PROGRAMFILES%\Avira\AntiVir ...\avscan.exe"
Scanner parameter: /CFG="C:\filescan.avp" /PATH="%f"


This I have tried but without success.

Anymore help would be gratefully received.
Best regards,
Alan.
Last edited by trusted on 17 Nov 2009 00:39, edited 1 time in total.

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Help with User Button (CTB1) to scan with my virus checker

Post by zer0 »

Therein lies a difficulty. From the article that I linked to, it's unclear whether it's possible to scan multiple files using command line arguments, just as jacky suspected. For further clarification on this it's best to contact Avira tech support. If it's not possible then no scripting trickery would make it work. If I am not mistaken, does Avira not have a context menu entry to scan selected files? Another quick Google search suggested that it has, so perhaps that's the answer in this case? ;)
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

Muroph
Posts: 561
Joined: 21 Aug 2007 16:13

Re: Help with User Button (CTB1) to scan with my virus checker

Post by Muroph »

i have avira , so i could try a few scripts.
the first thing i noticed was that <items> was not being resolved in the openwith command.
also, it seems like you can only pass one item to avira via cmdl.
this is what i came up with:

Code: Select all

$item=(getinfo(countselected)<1)?(<curpath>):(<curitem>);
  open """%programfiles%\Avira\AntiVir Desktop\avscan.exe"" /PATH=""$item""";
it will scan the current item or the current path (if nothing is selected on the list).

EDIT:
zer0 wrote:Therein lies a difficulty. From the article that I linked to, it's unclear whether it's possible to scan multiple files using command line arguments, just as jacky suspected. For further clarification on this it's best to contact Avira tech support. If it's not possible then no scripting trickery would make it work.
from what i've seen avscan only works with one file|folder at a time via cmdl.
there's a more powerful dedicated command line version, but i never tested it.
zer0 wrote:If I am not mistaken, does Avira not have a context menu entry to scan selected files? Another quick Google search suggested that it has, so perhaps that's the answer in this case? ;)
yeah, it does.
and with this you can scan many selected items at once.
My shared scripts:
TeraCopy Integration, Tag Manager, Comments Menu, Text Replacer, Image and Media Tools, Checksum Calculator, Video Calculator
only 5 URLs are allowed on the sig...

zer0
Posts: 2676
Joined: 19 Jan 2009 20:11

Re: Help with User Button (CTB1) to scan with my virus checker

Post by zer0 »

Muroph wrote:
zer0 wrote:If I am not mistaken, does Avira not have a context menu entry to scan selected files? Another quick Google search suggested that it has, so perhaps that's the answer in this case? ;)
yeah, it does.
and with this you can scan many selected items at once.
trusted, is this functionality that is already provided by Avira sufficient or there's something inconvenient about using it that way?
Reporting a bug? Have a wish? Got a question? Use search - View roadmap - FAQs: Forum + XY site
Windows 7/10
Always using the latest stable two-decimal build

trusted
Posts: 3
Joined: 16 Nov 2009 21:02

Re: Help with User Button (CTB1) to scan with my virus checker

Post by trusted »

zer0 wrote:
Muroph wrote:
zer0 wrote:If I am not mistaken, does Avira not have a context menu entry to scan selected files? Another quick Google search suggested that it has, so perhaps that's the answer in this case? ;)
yeah, it does.
and with this you can scan many selected items at once.
trusted, is this functionality that is already provided by Avira sufficient or there's something inconvenient about using it that way?
No it's just fine. It was only something I was trying to do as part of my learning curve with Xyplorer. I would have to go and pick something that has proved hard to adapt to a User Button.

Anyway a big thanks to everyone who tried to help.

Best regards,
Alan.

j_c_hallgren
XY Blog Master
Posts: 5826
Joined: 02 Jan 2006 19:34
Location: So. Chatham MA/Clearwater FL
Contact:

Re: Help with User Button (CTB1) to scan with my virus checker

Post by j_c_hallgren »

trusted wrote:Hello this is my first time on these forums so please be gentle with me.

Can some kind person please help?
Hi and a belated welcome to the XY forums from me also!

As you probably have seen, we are (I think) one of the quickest, friendliest and helpful forums for a software appl! The only time we can be harsh to a first timer is when they post a long list of "wishes" (aka demands :P ) without having done much, if any, research on the forums first or similar...and you didn't do that so we treated you as such.

Hopefully you'll become a regular here and then also purchase XY (if you'd not done so).
Still spending WAY TOO much time here! But it's such a pleasure helping XY be a treasure!
(XP on laptop with touchpad and thus NO mouse!) Using latest beta vers when possible.

Post Reply