Tuesday, October 27, 2026

How to create extension in chrome

 

Step 1: Create a Folder

Create a new folder on your computer and name it something like SearchAndViewExtension.

Step 2: Create the Configuration File (manifest.json)

Inside that folder, create a file named manifest.json and paste the following code. This tells Chrome to register a background service worker and requests permission to run scripts:

json

{

  "manifest_version": 3,

  "name": "Run Snippet from Right Click",

  "version": "1.0",

  "permissions": [

    "contextMenus",

    "activeTab",

    "scripting"

  ],

  "background": {

    "service_worker": "background.js"

  }

}

Use code with caution.

Step 3: Create the Background Script (background.js)

Inside the same folder, create a file named background.js. This script creates the actual right-click menu item and injects your click automation automation script into the page when clicked:

javascript

// 1. Create the right-click menu item when the extension installs

chrome.runtime.onInstalled.addListener(() => {

  chrome.contextMenus.create({

    id: "runSearchAndViewAutomation",

    title: "Run Search & View Automation",

    contexts: ["all"] // Makes it appear on any right-click

  });

});

 

// 2. Listen for clicks on your custom menu item

chrome.contextMenus.onClicked.addListener((info, tab) => {

  if (info.menuItemId === "runSearchAndViewAutomation") {

    // Inject and execute your snippet script directly onto the active tab

    chrome.scripting.executeScript({

      target: { tabId: tab.id },

      func: automatedSearchAndView

    });

  }

});

 

// 3. Your core snippet script wrapped in a function

async function automatedSearchAndView() {

  const searchButton = document.querySelector('#search-btn-id'); // <-- Change selector as needed

 

  if (!searchButton) {

    console.error("Automation Stopped: Search button not found.");

    return;

  }

 

  searchButton.click();

  console.log("Search button clicked. Monitoring DOM for the anchor tag...");

 

  const waitForElement = (selector, timeout = 5000) => {

    return new Promise((resolve, reject) => {

      const startTime = Date.now();

      const interval = setInterval(() => {

        const element = document.querySelector(selector);

        if (element) {

          clearInterval(interval);

          resolve(element);

        } else if (Date.now() - startTime > timeout) {

          clearInterval(interval);

          reject(new Error(`Automation Timeout: Link "${selector}" not found.`));

        }

      }, 100);

    });

  };

 

  try {

    const viewAnchor = await waitForElement('a.your-class-name'); // <-- Change selector as needed

   

    if (viewAnchor.href && viewAnchor.href !== '#' && !viewAnchor.href.startsWith('javascript:')) {

      window.location.href = viewAnchor.href;

    } else {

      viewAnchor.click();

    }

  } catch (error) {

    console.error(error.message);

  }

}

Use code with caution.

Step 4: Load it into Google Chrome

1.      Open Chrome and navigate to chrome://extensions/

2.      Turn ON the toggle switch for Developer mode in the top-right corner.

3.      Click the Load unpacked button in the top-left corner.

4.      Select the SearchAndViewExtension folder you created.

 

Wednesday, October 21, 2026

How to slow a computer

 In c drive where is windows installed , Make memory to 0 mb

drive free space to 1 mb


2) Open a large excel file with2 gb and copy form one excel file to another

Wednesday, September 2, 2026

Powershell select query for windows with tables

 Get-CimInstance -Query "select * from Win32_OperatingSystem "

Get-CimInstance -Query "SELECT * FROM Win32_SystemDriver WHERE Name='ntfs'"


Get-CimInstance -Query "select * from win32_baseService where Name='Themes'"


tables


Win32_Service

Win32_SystemDriver


⚙️ Operating System Core & Drivers
  • Win32_Service: Standard Windows background services (the counterpart to system drivers).
  • Win32_PnPSignedDriver: Digital signature and version details for Plug-and-Play drivers (great for checking if a driver is outdated).
  • Win32_Bus: Physical and logical expansion buses (like PCI, USB).
  • Win32_DeviceChangeEvent: Monitors when devices/drivers are added or removed from the system.
🔌 Physical Hardware & Devices
  • Win32_PnPEntity: Every Plug-and-Play device recognized by Device Manager (cameras, mice, keyboards, etc.).
  • Win32_DiskDrive: Physical hard drives and SSDs (shows model, serial number, and size).
  • Win32_VideoController: Graphics cards/GPUs and active video drivers.
  • Win32_NetworkAdapter: Physical and virtual network cards.
🖥️ System Management & Memory
  • Win32_Processor: CPU details (cores, clock speed, current load).
  • Win32_PhysicalMemory: Physical RAM sticks (shows capacity, speed, and manufacturer).
  • Win32_BIOS: Motherboard BIOS/UEFI version, serial number, and manufacturer.
  • Win32_OperatingSystem: General Windows details (build version, boot time, registered user).


Friday, August 21, 2026

How to open notepad and type with batch file

 @echo off

title Type Text Automation


:: 1. Open Notepad

start "" notepad.exe

echo Waiting for Notepad to open...

timeout /t 2 >nul


:: 2. Create a temporary script to type text

set "VBS_FILE=%temp%\type_text.vbs"


(

echo Set objShell = WScript.CreateObject^("WScript.Shell"^)

echo ' Make sure Notepad is the active window

echo objShell.AppActivate "Notepad"

echo WScript.Sleep 500

echo ' Type the characters

echo objShell.SendKeys "abcd"

) > "%VBS_FILE%"


:: 3. Execute the typing script

cscript //nologo "%VBS_FILE%"


:: 4. Delete the temporary script file

del "%VBS_FILE%"


echo Done!

timeout /t 2 >nul


How to create notepad file with batch file

 @echo off

title Text Steps Recorder

cls

echo ==========================================

echo TYPE YOUR STEPS BELOW (Press Enter after each line)

echo Type "EXIT" and press Enter when finished.

echo ==========================================

echo.


:loop

set /p userinput="Enter text/step: "

if "%userinput%"=="EXIT" goto end

if "%userinput%"=="exit" goto end


:: This saves what you typed into a file called keystrokes.txt

echo %userinput% >> keystrokes.txt

goto loop


:end

echo.

echo Recording saved to keystrokes.txt!

pause