Jump to content

automating Running Adaware


agtsmith

Recommended Posts

I'm having problem running a batch file from a cd to run adware 1.06 installed on a customers machine I'm using the shortcut right now but it's preventing me from auto running, updating and removing with the provided commands from lavasoft. Anyways i've tried using START C:\PROGRA~1\Lavasoft\AD-AWA~1\Ad-Aware.exe it works on a few machines but it craps out on others it says it can't find the file, is there another way to run it or change the default install directory with the silent command Thanks

Link to comment
Share on other sites


Have you tried placing "'s around the path and filename and having the full path with spaces in it?

You could also use the IF EXIST command something like this too:

IF EXIST C:\PROGRA~1\Lavasoft\AD-AWA~1\Ad-Aware.exe GOTO AD1
IF EXIST C:\.... GOTO AD2

GOTO ERROR

:AD1
ECHO found adaware - loading...
ECHO.

START C:\PROGRA~1\Lavasoft\AD-AWA~1\Ad-Aware.exe

GOTO END

:AD2
ECHO found adaware - loading...
ECHO.

START C:\...

GOTO END

:ERROR
ECHO Adaware was not found on this computer - please make sure it is properly installed to a known location and try again...
ECHO.

pause

:END

[please note - its a very crude way of doing it and i've only quickly made it hehe no flaming on how rubbish it is hehe]

Using a loop would be even better but I'm a bit vague with the FOR command but it's probably a more efficient way of doing it.

Hope this somehow helps.

Regards,

N.

Link to comment
Share on other sites

nope that won't work tried it, it's because the file names are to long, i know thier is some kind of limition with batch files and the number of characters u can use

Edited by agtsmith
Link to comment
Share on other sites

it_ybd thanks alot, the code u gave me the if exist works great i just made about 4 AD-AWA~ with 1,2,3,4 behind it and works if anyone who wants to fully run spybot and adaware, to run fix and update also added spysweeper but it doesn't update and run on it's own (I dont think spysweeper 3.5 accepts switches) also you could take away the wait commands and make them all run at the same time and make it a 1 button fix

ECHO Running Spyware Programs

START /wait C:\PROGRA~1\SPYBOT~1\SpybotSD.exe /autoupdate /autoimmunize /autocheck /autofix

IF EXIST C:\PROGRA~1\Lavasoft\AD-AWA~1\Ad-Aware.exe GOTO AD1

IF EXIST C:\PROGRA~1\Lavasoft\AD-AWA~2\Ad-Aware.exe GOTO AD2

IF EXIST C:\PROGRA~1\Lavasoft\AD-AWA~3\Ad-Aware.exe GOTO AD3

IF EXIST C:\PROGRA~1\Lavasoft\AD-AWA~4\Ad-Aware.exe GOTO AD4

GOTO ERROR

:AD1

ECHO found adaware - loading...

ECHO.

START /wait C:\PROGRA~1\Lavasoft\AD-AWA~1\Ad-Aware.exe /custom +archives +update +auto

GOTO END

:AD2

ECHO found adaware - loading...

ECHO.

START /wait C:\PROGRA~1\Lavasoft\AD-AWA~2\Ad-Aware.exe /custom +archives +update +auto

GOTO END

:AD3

ECHO found adaware - loading...

ECHO.

START /wait C:\PROGRA~1\Lavasoft\AD-AWA~3\Ad-Aware.exe /custom +archives +update +auto

GOTO END

:AD4

ECHO found adaware - loading...

ECHO.

START /wait C:\PROGRA~1\Lavasoft\AD-AWA~4\Ad-Aware.exe /custom +archives +update +auto

GOTO END

:ERROR

ECHO Adaware was not found on this computer - please make sure it is properly installed to a known location and try again...

ECHO.

pause

:END

START /wait C:\PROGRA~1\Webroot\SPYSWE~1\SPYSWE~1.EXE

Link to comment
Share on other sites

Glad it worked for you - I only made it up quickly so may have left mistakes in it, but glad it was ok :)

what exactly does the line START C:\... do,

... meant whatever the next path and file name you wanted to put down was lol ;)

:thumbup

Regards,

Nath

Link to comment
Share on other sites

There is not limit for batches... Probably longest single-command I am using is this:

\\server\instal\technici\user\_working_on\usmt\bin\scanstate.exe 
             \\server\instal\technici\user\_working_on\usmt\profiles\PC1
             /i:\\server\instal\technici\user\_working_on\usmt\Bin\MigSys.inf
             /i:\\server\instal\technici\user\_working_on\usmt\Bin\MigUser.inf
             /i:\\server\instal\technici\user\_working_on\usmt\Bin\MigIsm.inf
             /i:\\server\instal\technici\user\_working_on\usmt\Bin\ExcludeDir.inf
             /i:\\server\instal\technici\user\_working_on\usmt\Bin\IncludeFiles.inf
             /i:\\server\instal\technici\user\_working_on\usmt\Bin\sysfiles.inf /compress+
             /l:\\server\instal\technici\user\_working_on\usmt\logs\PC1\SaveDetails.log
             /progress:\\server\instal\technici\user\_working_on\usmt\logs\PC1\SaveSummary.log  /o /v:1 /c /localonly  
             /user:Domain\User1 /user:Domain\User2 /user:Domain\User3
             /user:Domain\User4

(this example is with expanded variables)

Link to comment
Share on other sites

Here is another way of doing the Ad-Aware

@echo off
for /f "tokens=*" %%a in ('dir "%ProgramFiles%" /b/s^|findstr /i "\\ad-aware.exe$" ^2^>nul') do (
 if errorlevel 0 echo start "" /wait %%~sa /custom +archives +update +auto
)
goto :eof

The above is merely an example to show you, anyone with Ad-Aware installed can test it. When you have verified from the output it works, just remove 'echo '

Link to comment
Share on other sites

Here is another way of doing the Ad-Aware
@echo off
for /f "tokens=*" %%a in ('dir "%ProgramFiles%" /b/s^|findstr /i "\\ad-aware.exe$" ^2^>nul') do (
 if errorlevel 0 echo start "" /wait %%~sa /custom +archives +update +auto
)
goto :eof

The above is merely an example to show you, anyone with Ad-Aware installed can test it. When you have verified from the output it works, just remove 'echo '

This didnt work for me

Link to comment
Share on other sites

@TheeBeets

This has been tested and confirmed working on forty seven different machines this morning. Those include Windows XP Home and Pro and Windows 2000.

It's no good guessing, take a look here

  • HKCU\Software\Microsoft\Command Processor
    look for a dword of 00000001 under the value EnableExtensions

If the values dont exist either add them or ensure that they exist under

  • HKLM\Software\Microsoft\Command Processor

There is nothing special to the commands,

It searches a directory listing of \Program Files for any line which ends in, (case insensitive), \Ad-Adware.exe if found an 8.3 filename version of the location is used.

Since you clearly have a line ending with \Ad-Aware.exe in \Program Files directory the only obvious solution is regarding command extensions.

If command extensions are enabled, what output are you getting? If you are getting none, change the first line to

  • @echo on

and let me know of anything pertinent from the screen output.

<Edit>

I have had another more obvious thought, are you just double clicking the cmd file?

If you are then the file will run but not stay open for you to see the result. You will need to either

  • 1. open the cmd prompt, navigate to the directory containing your cmd file and enter the name of the file, (extension not necessary)
    2. Add a pause, so you can see the output, (Example)
    Test.cmd
@echo off
for /f "tokens=*" %%a in ('dir "%ProgramFiles%" /b/s^|findstr /i "\\ad-aware.exe$" ^2^>nul') do (
if errorlevel 0 echo start "" /wait %%~sa /custom +archives +update +auto
)
pause&goto :eof


LavaAd.cmd (after testing)

@echo off
for /f "tokens=*" %%a in ('dir "%ProgramFiles%" /b/s^|findstr /i "\\ad-aware.exe$" ^2^>nul') do (
if errorlevel 0 start "" /wait %%~sa /custom +archives +update +auto
)
goto :eof


</Edit>

Edited by Yzöwl
Link to comment
Share on other sites

If the values dont exist either add them or ensure that they exist

running

setlocal enableextensions

will enable them from the .bat file

p.s. try `dir "%ProgramFiles%\a*" /b/s` or even better `dir "%ProgramFiles%\a*.exe" /b/s` ;)

Edited by tbma
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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...