Foolish website

Discuss any other Foolish IT app here (including the legacy apps dMaintenance, dSupport, etc.)
Suggest ideas for new Foolish IT apps here also.
Forum rules
1. Try to give more than you take, when possible.
2. Don't be a prick.
3. When posting for help, include the app's version, OS details, and steps to reproduce the issue.

Foolish website

Postby xide » Fri Aug 22, 2014 12:13 am

I was browsing through the website and noticed several other things Nick has to offer. The most being a way to create my own setup installer, and misc. vbs and bat files (since i'm a script whore)
However when hoping to download these items, there is no download link when viewing in firefox....I even cringed with the very thought but still I opened up internet explorer and I got the same results after it had the nerve to ask to be my default browser. :lol: .

The only plugin I use with firefox is adblock plus. I use no plugins on IE (because I obviously don't use it) I also have cleaned all temp files, cache, etc. (ccleaner)

Here is what it looked like (on both browsers):
Attachments
create_installers.jpg
create_installers.jpg (89.64 KiB) Viewed 10260 times
If I had a world of my own, everything would be nonsense.....Who in the world am I? Ah, that's the great puzzle. I'm afraid I can't explain myself, sir. Because I am not myself, you see?
User avatar
xide
 
Posts: 452
Joined: Tue Mar 19, 2013 12:43 am

Re: Foolish website

Postby xide » Fri Aug 22, 2014 2:03 am

After a little determinination/curiosity I found them all (don't ask) :roll:
Open up notepad (or your fav text editor) copy the code and paste it in the text editor and save as whatever you wish as long as it has the file extention (.cmd,.vbs, etc.)
I have left the original file names if you just want to copy and paste that when you save them.
Just thought i'd share the missing links/files with anyone else who couldn't view the files or links (and yes I was that bored to paste them all.) :lol:

Inno setup Custom installer
ref: https://foolishit.com/tech-info/creating-installers/

Sample Inno setup script
- Save text as setup.iss
Code: Select all
[Setup]
AppId={{5E782F49-E191-48AE-BF80-617099A329C6}
AppName=Computer Tech Remote Support
AppVerName=Computer Tech Remote Support
AppPublisher=Computer Tech
AppPublisherURL=www.mywebsite.com
AppSupportURL=www.mywebsite.com
AppUpdatesURL=www.mywebsite.com
DefaultDirName={pf}\Computer Tech
DisableDirPage=yes
DefaultGroupName=Computer Tech
DisableProgramGroupPage=yes
OutputDir=.
OutputBaseFilename=RemoteSupportSetup
Compression=lzma
SolidCompression=yes
VersionInfoVersion=1.0.0.0
PrivilegesRequired=admin
MinVersion=0,5.0

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"

[Files]
Source: "RemoteHelp.exe"; DestDir: "{app}"; Flags: ignoreversion

[Icons]
Name: "{group}\www.mywebsite.com"; Filename: "http://www.mywebsite.com"
Name: "{group}\Computer Tech Remote Support"; Filename: "{app}\RemoteHelp.exe"
Name: "{commondesktop}\Computer Tech Remote Support"; Filename: "{app}\RemoteHelp.exe"; Tasks: desktopicon

[Run]

[UninstallDelete]
Type: files; Name: "{app}\*.*"
Type: dirifempty; Name: "{app}"


*********************BAT files*************************
ref: https://foolishit.com/tech-info/batch-files/


Archive Web Logs - save as ArchiveWebLogs.cmd
Code: Select all
:: ArchiveWebLogs.cmd by John N. Shaw
::
:: Created:        10-30-07
:: Last Modified:  10-30-07
::
:: Archives log files older than xx days across multiple folders by using
:: rar.exe (this can of course be changed to whatever program you use, just
:: remember to change the parameters!)
::
:: Expected format: 
::       Drive:\domainpath\???????\logspath\????????\Ex??????.log
::       Where Ex??????.log represents year/month/day in YYMMDD format. 
::
:: Years are counted as 365 days, Months as 30 days, so results are approximate.
:: Script will produce odd results by the year 2100.  All because I am lazy. 
::
:: Be sure to set static varaibles below according to your needs.
::
:: This batch accepts no parameters but could easily be modified to do so.
::
:: Direct all complaints to your mother. 


   @echo off&title %~nx0&setlocal enableextensions enabledelayedexpansion
   

:: SET STATIC VARIABLES HERE

   :: Drive Letter script will run on
   set drive=C
   
   :: Sub Path domains are found in
   set dpath=domains
   
   :: Name of log file path in domain
   set logsubdir=logs
   
   :: Archive any log older than these days
   set daystokeep=90
   
   :: WinRAR temp and batch temp working directory
   set arctemp=D:\temp
   
   :: WinRAR temp archive file list
   set wrarlist=archive_these.txt
   
   
   if not exist "%drive%:\%dpath%" (
      echo Domain path not found!&pause&goto :eof
   )
   rar.exe
   if "%errorlevel%"=="9009" (
      echo.&echo RAR not found!&pause&goto :eof
   )
   
   call :cleanup
   

:: CURRENT DATE CONVERTED TO YYMMDD

   
   for /f "tokens=1,2,3,4 delims=/ " %%a in ('date /t') do (
      set cyear=%%d
      set cmonth=%%b
      set cday=%%c
      set today=!cyear:~-2!%%b%%c
   )
   

:: SUBTRACT %daystokeep% FROM CURRENT DATE


   :: Stripping leading zeros next two loops...
   :mzero
   if not "%cmonth:~0,1%"=="0" goto :mzdone
   if "%cmonth%"=="0" goto :mzdone
   set cmonth=%cmonth:~1%
   goto :mzero
   :mzdone
   
   :dzero
   if not "%cday:~0,1%"=="0" goto :dzdone
   if "%cday%"=="0" goto :dzdone
   set cday=%cday:~1%
   goto :dzero
   :dzdone

   set /a yeardays=%cyear% * 365
   set /a monthdays=%cmonth% * 30
   set /a totaldays=%yeardays% + %monthdays% + %cday%
   set /a olderthan=%totaldays% - %daystokeep%


:: MEAT

   
   %drive%:
   cd\"%dpath%"
   for /f "tokens=*" %%_ in ('dir /a:d /b') do (
      cd "%%_\%logsubdir%"
      if not errorlevel 1 (
         for /f "tokens=*" %%a in ('dir /a:d /b') do (
            set lastdir=%%a
            cd "%%a"
            call :parfname
            if exist "%arctemp%\%wrarlist%" call :archive
            cd ..
         )
         cd "%drive%:\%dpath%"
      )
   )
   goto :cleanup
   
   
:: PARSE FILENAME FOR DATE SUBROUTINE

   :parfname
   for /f "tokens=*" %%_ in ('dir /b *.log') do (
      set tfile=%%_
      set tyear=20!tfile:~2,-8!
      set tmonth=!tfile:~4,-6!
      set tday=!tfile:~6,-4!
      call :math
   )
   goto :eof
   
   
:: COMPARE AGE OF FILE SUBROUTINE


   :math
   
   :: Stripping leading zeros again, with year this time.

   :tyzero
   if not "%tyear:~0,1%"=="0" goto :tyzdone
   if "%tyear%"=="0" goto :tyzdone
   set tyear=%tyear:~1%
   goto :tyzero
   :tyzdone

   :tmzero
   if not "%tmonth:~0,1%"=="0" goto :tmzdone
   if "%tmonth%"=="0" goto :tmzdone
   set tmonth=%tmonth:~1%
   goto :tmzero
   :tmzdone
   
   :tdzero
   if not "%tday:~0,1%"=="0" goto :tdzdone
   if "%tday%"=="0" goto :tdzdone
   set tday=%tday:~1%
   goto :tdzero
   :tdzdone

   set /a tyeardays=%tyear% * 365
   set /a tmonthdays=%tmonth% * 30
   set /a targetdays=%tyeardays% + %tmonthdays% + %tday%
   
   set targetpath=%cd%
   
   if %targetdays% LEQ %olderthan% (
      echo %targetpath%\%tfile%>> "%arctemp%\%wrarlist%"
   )
   goto :eof
   
   
   :prearc
   goto :eof
   
   
:: ARCHIVE ROUTINE FOR EACH LOGDIR GOES HERE AND CLEANS UP WHEN DONE   
   
   
   :archive
   
   if exist "%arctemp%\%wrarlist%" (
      rar a -m5 -n@"%arctemp%\%wrarlist%" "%targetpath%\%lastdir%.rar"
      for /f "tokens=*" %%_ in ('type "%arctemp%\%wrarlist%"') do (
         if exist "%%_" del /q "%%_"
      )
   )
   
   call :cleanup
   goto :eof
   
   
   
:: CLEANUP which runs before and after all functions of script   
   
   :cleanup
   
   if defined arctemp (
      if exist "%arctemp%\%wrarlist%" del /q "%arctemp%\%wrarlist%"
   )
   
   goto :eof




DelZBF - save as DelZBF.cmd
Code: Select all
:: DelZBF.cmd by John N. Shaw
:: direct all complaints to your mother
:: Created:    ?
:: Last edit:  5/12/07
::
:: Required OS:  Windows XP
::
:: Deletes zero byte files in the directory given as a parameter, or
:: current directory (after confirmation) if no parameters are given.
::
:: Subdirectories are scanned only in DRIVE mode
::
:: DRIVE mode ONLY produces the report file.  You may change this
:: yourself if you need to by commenting out two lines.  Notes in code.
::
:: Report file will reside in the target path
::
:: Usage examples:
::
:: delzbf.cmd drive
::   runs in entire drive mode, scans current drive and all subdirectories
::
:: delzbf.cmd drive d:
::   runs in entire drive mode, scans D: and all subdirectories
::
:: delzbf.cmd
::   runs in current directory, does not scan subdirectories
::
:: delzbf.cmd c:\documents and settings
::   runs in c:\documents and settings, does not scan subdirectories
::


  :: Getting conditions explained above here

   @echo off
   setlocal enableextensions

   set zbfcommand=dir/b/a-d/os
   set delcmd=del /q "%%a"
   set zbfreportfile=zerobyte_files_deleted.txt
   if [%1]==[] goto noinput

  :: To enable deletion of ZBF's in full drive mode, comment out the
  :: last two SET lines in this next IF block, but leave the first one!

   if [%1]==[drive] (
      set zbfcommand=dir/s/b/a-d/os
      set delcmd=echo "%%a"
      set zbfreportfile=zerobyte_files_found.txt
      goto drive
   )

   pushd "%1 %2 %3 %4 %5 %6 %7 %8 %9"
   if errorlevel 1 cls&echo PATH NOT VALID or EXCEEDS SPACE LIMITATIONS.&echo,&ECHO change directory to the path and run from there!&pause&goto :eof


:Start
   set reportzbf=%zbfreportfile%

   echo Path:  %cd% >> "%reportzbf%"
   set zbf=%temp%\zerobyte.ref
   
   cd.>"%zbf%"

   for /f "delims=" %%a in ('%zbfcommand%') do (
      fc "%zbf%" "%%a" >nul
      if errorlevel 1 (goto done) else (attrib -a -r -s -h "%%a"&%delcmd%&echo  - %%a >> "%reportzbf%")
   )
  :: above statement - fc has errorlevel 1 if differences found, errorlevel 0 if no differences


:Done
   del /q "%zbf%"
   popd
   goto :eof

:NoInput
   cls&echo,&echo No input given!  Using current directory:&echo,&echo "%cd%"&echo,&echo Press any key if this is ok or CTRL-C to abort.&pause>nul
   cls&goto start

:Drive
   set zbfdrive=%2
   if [%2]==[] (
      set zbfdrive=%~d0
      cls&echo,&echo No DRIVE LETTER given!  For example:&echo,&echo Use " delzbf.cmd drive c: " to scan the entire C: drive.&echo,&echo press any key to use the current drive:  %~d0  or CTRL-C to abort.&pause>nul
   )

   pushd %zbfdrive%\
   cls&echo,&echo When running on an entire drive, REPORT ONLY mode is enabled UNLESS&echo you have previously modified this file to enable it. 
   goto start




FindQs - save as findQs.cmd
Code: Select all
:: FindQs by John N. Shaw
:: direct all complaints to your mother
:: Created:    late 2006
:: Last edit:  3/11/08
::
:: Finds and reports ?'s in files which do not appear in Explorer
::
:: Ex:  Explorer shows "Symantec" when file/dir is actually named "?ymantec" or similar
:: (or rather, they are actually a localized or other uninterpretible character, and are
:: detected by CMD.EXE as a "?")  Not sure how it works... but I can find it, so I can fix it! 
::
:: Confirmed to be used by newer malware; suspect it is (mis)use of localized character sets. 
::
:: Although the "?" doesn't show up in Explorer, it does recognize the character as NOT an "S" for
:: example, so I first discovered the anomaly when changing Explorer's file/dir sort order to
:: "by Name" and seeing "Symantec" listed AFTER "Windows Update" was the tip off. 
::
:: The current batch will not delete the ?'s automatically as "?" is interpreted as a wildcard by
:: CMD.EXE and will delete every character in place of the "?" ... in addition, the client may actually
:: be using a localized character set and you might be deleting his Word docs or whatever!
::
:: USAGE:  run FindQs.cmd with a drive letter and colon as the only parameter to scan that drive
:: EX:     FindQs.cmd C:

@echo off

title FindQs - Scanning %1

if [%1]==[] echo No Guest Drive specified! & pause & goto :eof

pushd "%~dp0"

set guest=%1


:start
   set qfound=
   del /s "%Temp%\findqout.txt">nul
   cls
   pushd "%guest%\"
   dir/s/a:d/b|find "?"
   if errorlevel=1 goto ph1f
   set qfound=on
   call :fmsg
   echo    ---=== Find these DIRECTORIES and delete them: ===--- >> "%Temp%\findqout.txt"
   echo, >> "%Temp%\findqout.txt"
   dir/s/a:d/b|find "?" >> "%Temp%\findqout.txt"
   echo, >> "%Temp%\findqout.txt"

:ph1f
   dir/s/a:-d/b|find "?"
   if errorlevel=1 goto end
   if not "%qfound%"=="on" call :fmsg
   set qfound=on
   echo    ---=== Find these FILES and delete them: ===--- >> "%Temp%\findqout.txt"
   echo, >> "%Temp%\findqout.txt"
   dir/s/a:-d/b|find "?" >> "%Temp%\findqout.txt"
   echo, >> "%Temp%\findqout.txt"
   goto end

:fmsg
   echo These directories and files are likely malicious, however they may be related >> "%Temp%\findqout.txt"
   echo to localized character sets that you may find on a system with the need to  >> "%Temp%\findqout.txt"
   echo display asian or russian characters for example.   >> "%Temp%\findqout.txt"
   echo, >> "%Temp%\findqout.txt"
   echo If they are malicious, when viewed through Windows explorer they will likely >> "%Temp%\findqout.txt"
   echo appear as normal names without the question marks and could appear to be exact >> "%Temp%\findqout.txt"
   echo duplicates of existing directories, so BE CAREFUL to delete the right ones!!! >> "%Temp%\findqout.txt"
   echo, >> "%Temp%\findqout.txt"
   echo Close this notepad *ONLY* when finished and the script will confirm the >> "%Temp%\findqout.txt"
   echo problem is resolved; else this window will continue to pop up until that time. >> "%Temp%\findqout.txt"
   echo, >> "%Temp%\findqout.txt"
   echo If you have weeded out the malware and still have non-malicious entries, you >> "%Temp%\findqout.txt"
   echo must force this loop/script to terminate itself by running "Stop FindQs" >> "%Temp%\findqout.txt"
   echo before closing this Notepad window.  This will allow AutoTBC to continue normally. >> "%Temp%\findqout.txt"
   echo ---------------------------------------------------------------------------------- >> "%Temp%\findqout.txt"
   echo, >> "%Temp%\findqout.txt"
   goto :eof

:end
   if not "%qfound%"=="on" goto :eof
   if exist "%Temp%\findqout.txt" (
      notepad "%Temp%\findqout.txt"
      if exist "%Temp%\findqout.txt" goto start
   )




Selective OS example - save as Selective_OS_Example.cmd
Code: Select all
:: set echo off and change to the current directory.
@echo off&pushd "%~dp0"

:: Common code can go here


:: Check Windows Version
ver | findstr /i "6\.0\." > nul
IF %ERRORLEVEL% EQU 0 goto Vista
ver | findstr /i "6\.1\." > nul
IF %ERRORLEVEL% EQU 0 goto Win7

:: Windows XP Code goes here
if exist "%programfiles% (x86)" (
   echo Do code for XP 64bit

) else (
   echo Do code for XP 32bit
   
)
goto :end

:Vista
:: Windows Vista Code goes here
if exist "%programfiles% (x86)" (
   echo Do code for Vista 64bit

) else (
   echo Do code for Vista 32bit

)
goto :end

:Win7
:: Windows 7 Code goes here
if exist "%programfiles% (x86)" (
   echo Do code for 7 64bit

) else (
   echo Do code for 7 32bit   

)

:end
:: More common code can go below here - remove the pause statement below to exit without pause. 
pause



Start Services
- save as StartServices.cmd
Code: Select all
:: -------------------------------------
:: Start_Services.cmd, by John N. Shaw
:: Created:   7-18-08
:: Modified:  7-18-08
::
:: Batch script to start any number of
:: services in any particular order.
:: Runs on NT based OSes, but designed
:: for and tested ONLY on Windows XP.
:: "Seconds" are not quite that but close.
:: -------------------------------------
@echo off&title Starting Windows Services...&set count=1


:: =========================
::   CONFIGURATION OPTIONS 
:: =========================


:: define the number of seconds you wish to wait until trying to start the service

set delay=10

:: define the number of times to retry starting a service before failing

set failnumber=3

:: to run additional passes at this script to ensure services you started stay that way.
:: set morepasses equal to the number of times you want to run this batch subsequently
:: set passdelay to xx seconds before you want to run the subsequent passes

set morepasses=1
set passdelay=25

:: if you want to stop any services first, add them here
:: each service name should be preceeded with call :stopsvc
:: do not use display names but actual service names
:: set stopdelay in seconds to wait for the service to stop

set stopdelay=10

REM call :stopsvc D3Vme
REM call :stopsvc D3odbcsv


:startbat
:: add each service name to start here in the order you want them started.
:: each service name should be preceeded with call :startsvc
:: do not use display names but actual service names

call :startsvc D3Vme
call :startsvc D3odbcsv


:: =========================
::     END CONFIGURATION
:: =========================


if not "%morepasses%"=="0" (
   set nowaitmsg=1
   echo.&echo Waiting for %passdelay% before running %morepasses% more passes...&echo.&echo.
   call :wait %passdelay%
   set /a morepasses=%morepasses% - 1
   goto :startbat
)
goto :end


:stopsvc
set svc=%1
echo Attempting to stop:  %svc%
sc stop %svc%
set nowaitmsg=1
echo Delaying %stopdelay% seconds after attempting stop %svc%&echo.
call :wait %stopdelay%
goto :eof

:startsvc
set svc=%1
call :wait %delay%
echo Attempting to start:  %svc%
sc query %svc% | find "STATE" | find "RUNNING"
if errorlevel 1 (
   sc start %svc% | find "FAILED"
   if errorlevel 0 (
      echo Failed to start:  %svc% &echo.
      set /a count=%count% + 1
      if "%count%"=="%failnumber%" (
         set count=1
         echo.
         goto :eof
      ) else (
         goto :startsvc
      )
   ) else (
      goto :startsvc
   )
) else (
   echo.
   call :wait %delay%
)
goto :eof

:wait
if not "%nowaitmsg%"=="1" (
   echo Delaying %delay% seconds before attempt to start:  %svc%
) else (
   set nowaitmsg=0
)
ping -n %1 127.0.0.1>nul
goto :eof

:end

:: NOTE you can place "pause" here without the quotes to stop the batch and review what happened



Test Batch - save as TestBatch.cmd
Code: Select all
:: batch by John N. Shaw
:: direct all complaints to your mother
:: Created:    4/17/07
:: Last edit:  4/17/07
::
:: Required OS:  NT-based
::
:: See where your batch is going wrong.  Generate a log!
::
:: Drag and Drop the batch file you wish to test on this batch file. 
:: Alternately, you could start your batch as a parameter to this one.
::
:: BE SURE TO TURN THE ECHO ON in the batch file you wish to test to
:: log everything and get the full effect. 
::
:: When testing batch that calls code in different batch files, you may
:: need to make additional modifications to each batch you are actually
:: trying to run.
::
:: Console output of your original batch will be disabled during this
:: test so know well where your "any key" and/or input prompts are. 
::

@echo off&cls&title %0&echo Preparing to run your batch file, please wait...
set fileloc="%~dp1"
:: pushd %fileloc%
set inputerror=
set reportfile=
set today=
set now=
set xret=
set xmsg=
set testfile=%~nx1
set fulltestfile=%1
set reportnameonly=%~nx1--report.txt
set reportfile="%~dp0%reportnameonly%"
echo Testing batch file:  "%~nx1" > %reportfile%
echo File location:       "%~dp1" >> %reportfile%
echo File Attributes:     "%~a1" >> %reportfile%
echo File Size:           "%~z1 bytes" >> %reportfile%
echo Creation/Mod date:   "%~t1" >> %reportfile%
echo Full 8.3 path/name:  "%~s1" >> %reportfile%
echo Command Line:        %1 %2 %3 %4 %5 %6 %7 %8 %9 >> %reportfile%
echo "%~n0" called from:  "%~dp0" >> %reportfile%
echo, >> %reportfile% >> %reportfile%
echo ---------------------------------------------------------  >> %reportfile%
echo Operation started on:  %date% - %time% >> %reportfile%
echo Output of "%~nx1" follows:  >> %reportfile%
echo ---------------------------------------------------------  >> %reportfile%
cls&echo Testing your backup batch file now... 
@echo on
shift
call %fulltestfile% %1 %2 %3 %4 %5 %6 %7 %8 %9 >> %reportfile% 2>&1
@echo off
for /f "tokens=1,2,3,4 delims=/ " %%a in ('date /t') do set today=%%b.%%c.%%d
for /f "tokens=1,2,3,4 delims=: " %%a in ('time /t') do set now=%%a.%%b.%%c
echo, >> %reportfile%
echo ---------------------------------------------------------  >> %reportfile%
echo Operation ended on:  %date% - %time% >> %reportfile%
echo End of output.  >> %reportfile%
echo, >> %reportfile%
echo "%testfile%" file contents are as follows:  >> %reportfile%
echo ---------------------------------------------------------  >> %reportfile%
echo. >> %reportfile%
type %fulltestfile% >> %reportfile%
echo. >> %reportfile%
echo. >> %reportfile%
echo ---------------------------------------------------------  >> %reportfile%
echo END OF REPORT >> %reportfile%
:: notepad %reportfile%
ren %reportfile% %reportnameonly%-%today%-%now%.txt
set inputerror=
set fileloc=
set reportfile=
set today=
set now=
set xret=
set testfile=
set fulltestfile=
set xmsg=



Unzip Nirsoft Apps - save as Unzip_Nirsoft_Apps.cmd
Code: Select all
@echo off

:: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
:: Directions:
::
:: 1 Put this batch file in same directory as all downloaded nirsoft zip files
::
:: 2 This file was download as .txt file, please rename to .bat or .cmd to make it
::   executable
::
:: 3 Make sure unzip.exe is in your path (e.g. \Windows directory)
::   I used Info-ZIP's unzip.exe from http://www.info-zip.org/ but you can use
::   your own command-line unzip utility just make sure to change the filename
::   and parameters in the loop code below. 
::
:: 4 On "set dest" line below set new directory you want to put all nirsoft utilities in
::
:: 5 Double click this batch file. 
:: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

set dest=c:\nirsoft

pushd "%~dp0"

if not exist %dest% md %dest%

:loop
move *.zip %dest%
pushd %dest%
for %%_ in (*.zip) do (
   unzip -o "%%_"
   if exist readme.txt ren readme.txt "%%~n_.readme.txt"
   del "%%_"
)




*********** VBS SCRIPTS SECTION*************

ref: https://foolishit.com/tech-info/vbs-files/


Check Security - save as CheckSecurity.vbs
Code: Select all
' Security Product Detection VBS by Foolish IT

' to test on a remote system, set strComp = TheComputerNameOfTheRemoteSystem
' script will fail if you don't have permission to query the system

Dim strComp, iAVCount, iFWCount, iASCount, sAV, sFW, sAS, bXP
strComp = "."

Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComp & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery ("Select * from Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
   if instr(objOperatingSystem.Caption, "XP") <> 0 then
      call XPSub
      bXP = True
   else
      call VistaSub
      bXP = False
   end if
Next

select case iAVCount
    case 0
   sAVMsg = "WARNING - No AntiVirus Product Detected!" & vbnewline  & vbnewline
    case 1
   sAVMsg = "AntiVirus Product:  " & sAV & vbnewline  & vbnewline
    case else
   sAVMsg = "WARNING - " & iAVCount & " AntiVirus Products Detected:" & vbnewline & vbtab & sAV & vbnewline  & vbnewline
end select

if bXP = False then
   select case iASCount
       case 0
      sASMsg = "WARNING - No AntiSpyware Product Detected!" & vbnewline  & vbnewline
       case 1
      sASMsg = "AntiSpyware Product:  " & sAS & vbnewline  & vbnewline
       case else
      sASMsg = "WARNING - " & iASCount & " AntiSpyware Products Detected:" & vbnewline & vbtab & sAS & vbnewline  & vbnewline
   end select
end if

select case iFWCount
    case 0
   sFWMsg = "No 3rd Party Firewall Detected." & vbnewline  & vbnewline
    case 1
   sFWMsg = "Firewall Product:  " & sFW & vbnewline  & vbnewline
    case else
   sFWMsg = "WARNING - " & iFWCount & " Firewall Products Detected:" & vbnewline & vbtab & sFW & vbnewline  & vbnewline
end select

Msgbox sAVMsg & sASMsg & sFWMsg, , "Security Product Detection VBS by Foolish IT"

Sub VistaSub
   Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComp & "\root\SecurityCenter2")   

   Set colAVItems = oWMI.ExecQuery("Select * from AntiVirusProduct")
   For Each objAntiVirusProduct In colAVItems
       If LenB(objAntiVirusProduct.DisplayName) > 1 Then
      sAVState = right(hex(objAntiVirusProduct.productstate), 4)
      if left(sAVState, 1) = "1" then
          sAVActive = "Enabled"
      else
          sAVActive = "Disabled"
      end if
      if mid(sAVState, 3, 1) = "0" then
          sAVCurrent = "Up to Date"
      else
          sAVCurrent = "Outdated!"
           end if
           if lenb(sAV) < 1 then
          ' only one here
          sAV = objAntiVirusProduct.DisplayName & " (" & sAVActive & ", " & sAVCurrent & ")"
          iAVCount = 1
      else
          ' multiple products end up here
          sAV = sAV & vbnewline & vbtab & objAntiVirusProduct.DisplayName & " (" & sAVActive & ", " & sAVCurrent & ")"
          iAVCount = iAVCount + 1
      End if
       End if
   Next

   Set colASItems = oWMI.ExecQuery("Select * from AntiSpywareProduct")
   For Each objAntiSpywareProduct In colASItems
       If LenB(objAntiSpywareProduct.DisplayName) > 1 Then
      sASState = right(hex(objAntiSpywareProduct.productstate), 4)
      if left(sASState, 1) = "1" then
          sASActive = "Enabled"
      else
          sASActive = "Disabled"
      end if
      if mid(sASState, 3, 1) = "0" then
          sASCurrent = "Up to Date"
      else
          sASCurrent = "Outdated!"
           end if
           if lenb(sAS) < 1 then
          ' only one here
          sAS = objAntiSpywareProduct.DisplayName & " (" & sASActive & ", " & sASCurrent & ")"
          iASCount = 1
      else
          ' multiple products end up here
          sAS = sAS & vbnewline & vbtab & objAntiSpywareProduct.DisplayName & " (" & sASActive & ", " & sASCurrent & ")"
          iASCount = iASCount + 1
      End if
       End if
   Next

   Set colFWItems = oWMI.ExecQuery("Select * from FirewallProduct")
   For Each objFirewallProduct In colFWItems
       If LenB(objFirewallProduct.DisplayName) > 1 Then
      sFWState = right(hex(objFirewallProduct.productstate), 4)
      if left(sFWState, 1) = "1" then
          sFWActive = "Enabled"
      else
          sFWActive = "Disabled"
      end if
           if lenb(sFW) < 1 then
          ' only one here
          sFW = objFirewallProduct.DisplayName & " (" & sFWActive & ")"
          iFWCount = 1
      else
          ' multiple products end up here
          sFW = sFW & vbnewline & vbtab & objFirewallProduct.DisplayName & " (" & sFWActive & ")"
          iFWCount = iFWCount + 1
      End if
       End if
   Next
end sub

sub XPSub
   Set oWMI = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComp & "\root\SecurityCenter") 

      Set colAVItems = oWMI.ExecQuery("Select * from AntiVirusProduct")
      For Each objAntiVirusProduct In colAVItems
             If LenB(objAntiVirusProduct.DisplayName) > 1 Then
            if objAntiVirusProduct.onAccessScanningEnabled = True then   
                sAVActive = "Enabled"
            else
                sAVActive = "Disabled"
            end if
            if objAntiVirusProduct.productUpToDate = true then
                sAVCurrent = "Up to Date"
            else
                sAVCurrent = "Outdated!"
            end if
            if lenb(sAV) < 1 then
                ' only one antivirus here
                sAV = objAntiVirusProduct.DisplayName & " (" & sAVActive & ", " & sAVCurrent & ")"
                iCount = 1
            else
                ' multiple antivirus ends up here
                sAV = sAV & vbnewline & objAntiVirusProduct.DisplayName & " (" & sAVActive & ", " & sAVCurrent & ")"
                iCount = iCount + 1
            End if
          End if
      Next

   Set colFWItems = oWMI.ExecQuery("Select * from FirewallProduct")
   For Each objFirewallProduct In colFWItems
       If LenB(objFirewallProduct.DisplayName) > 1 Then
      if objFirewallProduct.enabled = True then   
          sFWActive = "Enabled"
      else
          sFWActive = "Disabled"
      end if
           if lenb(sFW) < 1 then
          ' only one here
          sFW = objFirewallProduct.DisplayName & " (" & sFWActive & ")"
          iFWCount = 1
      else
          ' multiple PRODUCTS end up here
          sFW = sFW & vbnewline & vbtab & objFirewallProduct.DisplayName & " (" & sFWActive & ")"
          iFWCount = iFWCount + 1
      End if
       End if
   Next
end sub




Get product keys
- save as GetProductKeys.vbs
Code: Select all
' GetProductKeys.VBS v1.0 by Foolish IT

Const HKEY_LOCAL_MACHINE = &H80000002

WinKey = GetWinKey

OfficeKeys = GetOfficeKey("10.0") & GetOfficeKey("11.0") & GetOfficeKey("12.0") & GetOfficeKey("14.0") & GetOfficeKey("15.0")

If Msgbox(WinKey & vbnewline & vbnewline & OfficeKeys & vbnewline & "Save All Keys to ProductKeys.txt?", vbyesno, "GetProductKeys.VBS by Foolish IT") = vbyes then
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objTextFile = objFSO.CreateTextFile("ProductKeys.txt", True)
    objTextFile.Write WinKey & vbnewline & vbnewline & OfficeKeys
    objTextFile.Close
end if

Function GetOfficeKey(sVer)
    On Error Resume Next
    Dim arrSubKeys
    Set wshShell = WScript.CreateObject( "WScript.Shell" )
    sBit = wshShell.ExpandEnvironmentStrings("%ProgramFiles(x86)%")
    if sBit <> "%ProgramFiles(x86)%" then
   sBit = "Software\wow6432node"
    else
   sBit = "Software"
    end if
    Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
    objReg.EnumKey HKEY_LOCAL_MACHINE, sBit & "\Microsoft\Office\" & sVer & "\Registration", arrSubKeys
    Set objReg = Nothing
    if IsNull(arrSubKeys) = False then
        For Each Subkey in arrSubKeys
       if lenb(other) < 1 then other = wshshell.RegRead("HKLM\" & sBit & "\Microsoft\Office\" & sVer & "\Registration\" & SubKey & "\ProductName")
       if ucase(right(SubKey, 7)) = "0FF1CE}" then
                Set wshshell = CreateObject("WScript.Shell")
           key = ConvertToKey(wshshell.RegRead("HKLM\" & sBit & "\Microsoft\Office\" & sVer & "\Registration\" & SubKey & "\DigitalProductID"))
      oem = ucase(mid(wshshell.RegRead("HKLM\" & sBit & "\Microsoft\Office\" & sVer & "\Registration\" & SubKey & "\ProductID"), 7, 3))
        edition = wshshell.RegRead("HKLM\" & sBit & "\Microsoft\Office\" & sVer & "\Registration\" & SubKey & "\ProductName")
      if err.number <> 0 then
          edition = other
                   err.clear
      end if
           Set wshshell = Nothing
            if oem <> "OEM" then oem = "Retail"
           if lenb(final) > 1 then
          final = final & vbnewline & final
             else
               final = edition & " " & oem & ":  " & key
                end if
       end if
        Next
   GetOfficeKey = final & vbnewline
    End If
End Function

Function GetWinKey()
    Set wshshell = CreateObject("WScript.Shell")
    edition = wshshell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductName")
    oem = ucase(mid(wshshell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProductID"), 7, 3))
    key = GetKey("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId")
    set wshshell = Nothing
    if oem <> "OEM" then oem = "Retail"
    GetWinKey = edition & " " & oem & ":  " & key
End Function

Function GetKey(sReg)
    Set wshshell = CreateObject("WScript.Shell")
    GetKey = ConvertToKey(wshshell.RegRead(sReg))
    Set wshshell = Nothing
End Function

Function ConvertToKey(key)
    Const KeyOffset = 52
    i = 28
    Chars = "BCDFGHJKMPQRTVWXY2346789"
    Do
        Cur = 0
        x = 14
        Do
            Cur = Cur * 256
            Cur = key(x + KeyOffset) + Cur
            key(x + KeyOffset) = (Cur \ 24) And 255
            Cur = Cur Mod 24
            x = x - 1
        Loop While x >= 0
        i = i - 1
        KeyOutput = Mid(Chars, Cur + 1, 1) & KeyOutput
        If (((29 - i) Mod 6) = 0) And (i <> -1) Then
            i = i - 1
            KeyOutput = "-" & KeyOutput
        End If
    Loop While i >= 0
    ConvertToKey = KeyOutput
End Function


refer to the urls posted above for further details on scripts/apps as well as disclaimers.
If I had a world of my own, everything would be nonsense.....Who in the world am I? Ah, that's the great puzzle. I'm afraid I can't explain myself, sir. Because I am not myself, you see?
User avatar
xide
 
Posts: 452
Joined: Tue Mar 19, 2013 12:43 am

Re: Foolish website

Postby vmhs » Fri Aug 22, 2014 6:38 pm

Nice work Nick and Xide for finding these gems - thanks
vmhs
 
Posts: 180
Joined: Sat Jun 21, 2014 5:05 am

Re: Foolish website

Postby pdeedy » Wed Sep 03, 2014 6:54 am

Hi. I have the same issue.

I am trying to download the pxeconfig.zip file that should be linked here https://www.foolishit.com/tech-info/my- ... -syslinux/ but all I see it the Wordpress code [wpdm_package id=21].

I would be grateful if you could uncover this for me!

Paul.
pdeedy
 
Posts: 1
Joined: Wed Sep 03, 2014 6:39 am

Re: Foolish website

Postby Nick » Wed Sep 03, 2014 3:52 pm

Author of d7/d7II and other PC technician's tools. http://www.FoolishIT.com

Image
User avatar
Nick
Site Admin
 
Posts: 2718
Joined: Mon Nov 19, 2012 7:54 pm

Re: Foolish website

Postby Huskylogic » Wed May 06, 2015 1:39 pm

I love the line in the code that says "Direct all complaints to your mother." Too funny.
Strive not to be a success, but rather to be of value. –Albert Einstein
Huskylogic
 
Posts: 54
Joined: Sun May 03, 2015 11:32 pm
Location: Grand Island, NY

Re: Foolish website

Postby Michael » Mon May 11, 2015 1:38 pm

Remember, all the downloadable software on our site should be available from http://download.foolishit.com/ . It has come to our attention that Chrome has flagged this site as harboring potentially unsafe software. This is a false/positive. All of our software is safe. Please ignore the message if you are using Chrome and we will do our best to get it resolved with Google.
Image
User avatar
Michael
Foolish IT Staff
 
Posts: 23
Joined: Tue May 07, 2013 1:27 pm

Re: Foolish website

Postby Huskylogic » Mon May 11, 2015 1:41 pm

Yep they did that on a couple other sites as well.
Strive not to be a success, but rather to be of value. –Albert Einstein
Huskylogic
 
Posts: 54
Joined: Sun May 03, 2015 11:32 pm
Location: Grand Island, NY

Re: Foolish website

Postby xide » Tue May 12, 2015 12:57 am

Michael wrote:Remember, all the downloadable software on our site should be available from http://download.foolishit.com/ . It has come to our attention that Chrome has flagged this site as harboring potentially unsafe software. This is a false/positive. All of our software is safe. Please ignore the message if you are using Chrome and we will do our best to get it resolved with Google.


Yes all can be downloaded from download.foolishit.com. My original post was to only help the people who visit the above pages and wonder where the scripts are since the links are broken, and also to save them a lot of time digging though the download area trying to find a certain script that was on a certain page. That's why I did all the work for them :) Rule #1 is to give more than you take. So I like to go the extra mile for people if and when I can.
If I had a world of my own, everything would be nonsense.....Who in the world am I? Ah, that's the great puzzle. I'm afraid I can't explain myself, sir. Because I am not myself, you see?
User avatar
xide
 
Posts: 452
Joined: Tue Mar 19, 2013 12:43 am


Return to Other Foolish IT Apps