Showing posts with label windows. Show all posts
Showing posts with label windows. Show all posts

Tuesday, November 3, 2026

Creating Sub menu in Chrome extension - snippet for selecting 5th value in drop down list

 background.js

// 1. Create the main parent menu item

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

  chrome.contextMenus.create({

    id: "parentMenu",

    title: "My Extension Options",

    contexts: ["all"] // Shows up on text selection, links, pages, etc.

  });


  // 2. Create sub-menu items linked to the parent ID

  chrome.contextMenus.create({

    id: "subMenu1",

    parentId: "parentMenu",

    title: "Select 5th Option",

    contexts: ["all"]

  });


  chrome.contextMenus.create({

    id: "subMenu2",

    parentId: "parentMenu",

    title: "Clear Selection",

    contexts: ["all"]

  });

});


// 3. Handle clicks on the sub-menu items

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

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

    // Inject a script into the active page to select the 5th value

const activeTabId = info.tabId || (tab && tab.id);

    debugger;

    if (!activeTabId) {

      console.error("No active tab ID found.");

      return;

    }

    chrome.scripting.executeScript({

      target: { tabId: tab.id },

      func: selectFifthValue

    });

  } else if (info.menuItemId === "subMenu2") {

    console.log("Sub-menu 2 clicked!");

  }

});


// This function runs directly inside the web page's context

function selectFifthValue() {

  const selectElement = document.querySelector('select[formcontrolname="sectionName"]');

  if (selectElement && selectElement.options.length >= 5) {

    selectElement.selectedIndex = 5;

    selectElement.dispatchEvent(new Event('change', { bubbles: true }));

  }

  else {

  console.error("Dropdown not found. Check if your formControlName is correct.");

}

}

Saturday, October 31, 2026

Environment variable in windows

 >Right click on My computer

> Go to advanced system settings

> Click on Environment variable 

> Create a new User variable

> Enter variable name and value (example name yash and value is d:/)

> Press window button + R and then type %yash%

Wednesday, October 21, 2026

How to slow a computer - How to check computer speed online GPU speed and CPU speed

 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


To check gpu speed and slow down computer


 https://mprep.info/gpu/

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


How to copy txt file from notepad to new notepad using bat file - batch file

 @echo off

title Steps Replayer

cls

echo Ready to replay steps. 

echo You have 5 seconds to click inside the app where you want to type!

echo.

timeout /t 5


:: This block creates a temporary script to simulate automated typing

echo Set wshShell = wscript.CreateObject("WScript.Shell") > replay.vbs


:: This reads your saved text file and writes it into the automated typer

for /f "delims=" %%x in (portalchanges.txt) do (

    echo wshShell.SendKeys "%%x" >> replay.vbs

    echo wscript.sleep 500 >> replay.vbs

    echo wshShell.SendKeys "{ENTER}" >> replay.vbs

    echo wscript.sleep 500 >> replay.vbs

)


:: This runs the automatic typing script and then deletes the temporary file

cscript //nologo replay.vbs

del replay.vbs


echo.

echo Replay complete!

pause


Thursday, July 9, 2026

VS code color change of font in menu - In side bar - explorer - Visual code color change of font

 

In settings.json change below code:-


 "workbench.colorCustomizations": {

    // Changes the default text color of the sidebar/explorer

    "": "#758b7c", 

    "sideBar.foreground":"default",

    // Changes the text color of the currently selected/focused file

    "list.focusForeground": "#FFD700", 

    "menu.foreground":"#020202",

    // Changes the text color of active files or items when hovering

    "list.activeSelectionForeground": "#8400ff31",

    "list.hoverForeground": "#6e0ad2",

    "menu.selectionForeground": "#FFFFFF",

"menu.selectionBackground": "#be1919c6"


}


For changing color of keywords(font in text editor):-

"editor.tokenColorCustomizations": {"textMateRules": [
        {
            "scope": "storage.type",
            "settings": {
                "foreground": "#000000",
                "fontStyle": "bold"
            }
           
        }
    ]}

For changing color of this and return keyword

"editor.tokenColorCustomizations": {"textMateRules": [
        {
            "scope": "variable.language",
            "settings": {
                "foreground": "#666666",
                "fontStyle": "bold"
            }},
            {
            "scope": "keyword.control",
            "settings": {
                "foreground": "#666666",
                "fontStyle": "bold"
            }
        }
    ]}

Tuesday, April 7, 2026

Saturday, April 4, 2026

Font color change in window 11 - Font smoothing

> Open regedit.exe

> click on Computer

> Click on HKEY_CURRENT_USER

>Click on Control Panel

>Click on Colors

>Double Click on WindowText

> and change the value from 0 0 0 to 255 0 0  for red color

====================================

For font smoothing , go to

Computer\HKEY_CURRENT_USER\Control Panel\Desktop

click on FontSmoothing and change ethe value to 1

=====================================

For font change in window 11, see below link

https://www.wisecleaner.com/think-tank/585-How-to-Change-the-Font-on-Windows-11.html

=================

Computer\HKEY_CURRENT_USER\Control Panel\Desktop\Colors

--------------------------

or you can use Winaero Tweaker or Microsoft PowerToys

Tuesday, January 20, 2026

Scroll Button Meaning

> In Excel , Click on Cell, If scroll Lock is OFF than You can left and right the Cell.

> IF scroll Lock is ON than you can scroll Down or up scroll bars.

Friday, December 19, 2025

How to pause printer or stop printer for printing

>click on Start button

> Type Printers and scanners

>Select printer(Printer that you work like HP or Other) and Manage

> Click on Open Print Queue

> Click on Printer And Click on pause Printing(Check and Uncheck for Printing)