agtsmith Posted June 7, 2005 Share Posted June 7, 2005 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 More sharing options...
tarquel Posted June 7, 2005 Share Posted June 7, 2005 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 AD1IF EXIST C:\.... GOTO AD2GOTO ERROR:AD1ECHO found adaware - loading...ECHO.START C:\PROGRA~1\Lavasoft\AD-AWA~1\Ad-Aware.exeGOTO END:AD2ECHO found adaware - loading...ECHO.START C:\...GOTO END:ERRORECHO 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 More sharing options...
agtsmith Posted June 7, 2005 Author Share Posted June 7, 2005 thanks alot I will add it to my file at work tonite Link to comment Share on other sites More sharing options...
agtsmith Posted June 7, 2005 Author Share Posted June 7, 2005 what exactly does the line START C:\... do, I think possibly my problem lies with AD-AWA~1 sometimes is named AD-AWA~2 on some machines why is this? Link to comment Share on other sites More sharing options...
Delprat Posted June 7, 2005 Share Posted June 7, 2005 Why don't you use the long folder names ???START "" "C:\Program Files\Lavasoft\Ad-Aware\Ad-Aware.exe"(notice the empty "" -- not sure you need it... try !)@+ Link to comment Share on other sites More sharing options...
agtsmith Posted June 7, 2005 Author Share Posted June 7, 2005 (edited) 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 June 7, 2005 by agtsmith Link to comment Share on other sites More sharing options...
agtsmith Posted June 7, 2005 Author Share Posted June 7, 2005 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 fixECHO Running Spyware ProgramsSTART /wait C:\PROGRA~1\SPYBOT~1\SpybotSD.exe /autoupdate /autoimmunize /autocheck /autofixIF EXIST C:\PROGRA~1\Lavasoft\AD-AWA~1\Ad-Aware.exe GOTO AD1IF EXIST C:\PROGRA~1\Lavasoft\AD-AWA~2\Ad-Aware.exe GOTO AD2IF EXIST C:\PROGRA~1\Lavasoft\AD-AWA~3\Ad-Aware.exe GOTO AD3IF EXIST C:\PROGRA~1\Lavasoft\AD-AWA~4\Ad-Aware.exe GOTO AD4GOTO ERROR:AD1ECHO found adaware - loading...ECHO.START /wait C:\PROGRA~1\Lavasoft\AD-AWA~1\Ad-Aware.exe /custom +archives +update +auto GOTO END:AD2ECHO found adaware - loading...ECHO.START /wait C:\PROGRA~1\Lavasoft\AD-AWA~2\Ad-Aware.exe /custom +archives +update +auto GOTO END:AD3ECHO found adaware - loading...ECHO.START /wait C:\PROGRA~1\Lavasoft\AD-AWA~3\Ad-Aware.exe /custom +archives +update +autoGOTO END:AD4ECHO found adaware - loading...ECHO.START /wait C:\PROGRA~1\Lavasoft\AD-AWA~4\Ad-Aware.exe /custom +archives +update +autoGOTO END:ERRORECHO Adaware was not found on this computer - please make sure it is properly installed to a known location and try again...ECHO.pause:ENDSTART /wait C:\PROGRA~1\Webroot\SPYSWE~1\SPYSWE~1.EXE Link to comment Share on other sites More sharing options...
tarquel Posted June 8, 2005 Share Posted June 8, 2005 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 Regards,Nath Link to comment Share on other sites More sharing options...
Martin Zugec Posted June 8, 2005 Share Posted June 8, 2005 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 More sharing options...
Yzöwl Posted June 8, 2005 Share Posted June 8, 2005 Here is another way of doing the Ad-Aware@echo offfor /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 :eofThe 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 More sharing options...
TheeBeets Posted June 8, 2005 Share Posted June 8, 2005 Here is another way of doing the Ad-Aware@echo offfor /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 :eofThe 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 '<{POST_SNAPBACK}>This didnt work for me Link to comment Share on other sites More sharing options...
Yzöwl Posted June 8, 2005 Share Posted June 8, 2005 Is Ad-aware installed in the usual place, i.e. somewhere in \Program FilesWhat OS /are command extensions enabled? Link to comment Share on other sites More sharing options...
TheeBeets Posted June 9, 2005 Share Posted June 9, 2005 (edited) C:\Program Files\Lavasoft\Ad-Aware SE Professional\Ad-Aware.exeWindows Xp All other .cmd's work fine so I guess it is Edited June 9, 2005 by TheeBeets Link to comment Share on other sites More sharing options...
Yzöwl Posted June 9, 2005 Share Posted June 9, 2005 (edited) @TheeBeetsThis 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 hereHKCU\Software\Microsoft\Command Processorlook for a dword of 00000001 under the value EnableExtensionsIf the values dont exist either add them or ensure that they exist underHKLM\Software\Microsoft\Command ProcessorThere 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 onand 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 either1. 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 offfor /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 :eofLavaAd.cmd (after testing)@echo offfor /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 June 9, 2005 by Yzöwl Link to comment Share on other sites More sharing options...
tbma Posted June 9, 2005 Share Posted June 9, 2005 (edited) If the values dont exist either add them or ensure that they existrunning setlocal enableextensionswill enable them from the .bat filep.s. try `dir "%ProgramFiles%\a*" /b/s` or even better `dir "%ProgramFiles%\a*.exe" /b/s` Edited June 9, 2005 by tbma Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now