Code Monkey home page Code Monkey logo

node-sysutil's Introduction

Languages:

Tools/Frameworks:

Stats:

node-sysutil's People

Contributors

omiinaya avatar

Stargazers

 avatar

node-sysutil's Issues

implement toggleUAC

turn off:

reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 0 /f

turn on:

reg.exe ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA /t REG_DWORD /d 1 /f

implement toggleWinDef

turn off:

sc config WinDefend start= disabled
sc stop WinDefend

turn on:

sc config WinDefend start= auto
sc start WinDefend

fix diskcleanup hanging

not sure if caused by my config, elevated lib or my own code.

assuming it’s an issue with my os

implement disableScreenshots

const { exec } = require('child_process');

// This command disables the Windows "Print Screen" key, which is often used to take screenshots
exec('reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /v DisablePrintScreen /t REG_DWORD /d 1 /f', (error, stdout, stderr) => {
if (error) {
console.error(Error disabling screenshots: ${error});
return;
}

console.log('Screenshots disabled.');
});

implement setChromeHomepage

Open sidebar

Omar Minaya
could you write a nodejs script that changes the homepage of my chrome browser to roblox.com?

Sure! Here is a script that should do the trick:

Copy code
const fs = require('fs');
const path = require('path');

const chromePath = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';
const preferencesPath = path.join(process.env.HOME, 'Library/Application Support/Google/Chrome/Default/Preferences');

const preferences = JSON.parse(fs.readFileSync(preferencesPath, 'utf8'));
preferences.homepage = 'https://www.roblox.com';
fs.writeFileSync(preferencesPath, JSON.stringify(preferences));
This script assumes you are using a Mac and have Google Chrome installed in the default location. If this is not the case, you will need to modify the chromePath variable to point to the correct location of your Chrome binary.

To run the script, save it to a file (e.g. set-homepage.js) and run it with the following command:

Copy code
node set-homepage.js
After running the script, the next time you open Google Chrome, it should have a homepage of https://www.roblox.com.

I hope this helps! Let me know if you have any other questions.

Omar Minaya
could you do the same with Microsoft Edge?
Yes, here is a script that should do the trick:

Copy code
const fs = require('fs');
const path = require('path');

const edgePath = 'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe';
const preferencesPath = path.join(process.env.LOCALAPPDATA, 'Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\AC\MicrosoftEdge\User\Default\Preferences');

const preferences = JSON.parse(fs.readFileSync(preferencesPath, 'utf8'));
preferences.start_page = 'https://www.roblox.com';
fs.writeFileSync(preferencesPath, JSON.stringify(preferences));
This script assumes you are using Windows and have Microsoft Edge installed in the default location. If this is not the case, you will need to modify the edgePath variable to point to the correct location of your Edge binary.

To run the script, save it to a file (e.g. set-homepage.js) and run it with the following command:

Copy code
node set-homepage.js
After running the script, the next time you open Microsoft Edge, it should have a homepage of https://www.roblox.com.

I hope this helps! Let me know if you have any other questions.

Try again

Free Research Preview: ChatGPT is optimized for dialogue. Our goal is to make AI systems more natural to interact with, and your feedback will help us improve our systems and make them safer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.