Showing posts with label Batch Command. Show all posts
Showing posts with label Batch Command. Show all posts

Saturday, May 9, 2026

Disable device via command prompt in Windows 10

- First, you have to find device instance path (DIP) for the device in device manager.

- Then open notepad and copy the script below :

@echo off
pnputil /disable-device "device_instance_path"
exit

- Change the "device_instance_path" with the DIP of the device.

- Save it as "disabledevice.bat"

Sunday, October 15, 2023

Set Chrome Portable as Default Browser for Windows 10

 - To set Portable Chrome as default browser you need to run the following VBscript :

'Registers Google Chrome Portable with Default Programs or Default Apps in Windows
'chromeportable.vbs - created on May 20, 2019 by Ramesh Srinivasan, Winhelponline.com
'v1.1 13-June-2019 - Enclosed file name parameter in double-quotes.
'v1.2 10-Sept-2020 - Fixed ApplicationIcon path. And added other supported URL protocols.
'v1.3 23-July-2022 - Minor bug fixes.

Option Explicit
Dim sAction, sAppPath, sExecPath, objFile, oFSO, sbaseKey, sbaseKey2, ArrKeys, regkey
Dim WshShell : Set WshShell = CreateObject("WScript.Shell")
Dim oFS0 : Set oFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = oFSO.GetFile(WScript.ScriptFullName)
sAppPath = oFSO.GetParentFolderName(objFile)
sExecPath = sAppPath & "\GoogleChromePortable.exe"

Tuesday, June 20, 2023

Lost Saga Origin Vfun Launcher

Create batch file inside Vfun folder and copy paste the following script :

@echo off
reg export HKEY_CURRENT_USER\SOFTWARE\Valofe vfun.reg /y
exit

Then save it as "Update registry vfun.bat"

Create another batch file inside Vfun folder and copy paste the following script

@echo off
regedit /s vfun.reg
start "" RegAsm.exe loginSNS.dll /silent
start "" "VFUNLauncher.exe
exit

Then save it as "Vfun_launcher.bat". Use it as Launcher for client.

Wednesday, March 29, 2023

Friday, November 4, 2022

Install driver via command prompt

pnputil.exe -i -a "full of path of the inf file\example.inf"

For example :

pnputil.exe -i -a "E:\bat\intelmanagement\heci.inf"

Tuesday, October 26, 2021

Set or Change DNS Server in Windows 7/8/10 using Command Prompt

 First, run command prompt as administrator, then type the following command and press enter for each line :

netsh interface ipv4 set dnsservers "Local Area Connection" static 8.8.8.8 primary
netsh interface ipv4 add dnsserver "Local Area Connection" 8.8.4.4 index=2

Note :

- Change 8.8.8.8 or 8.8.4.4 with your DNS Server.

- First line is to set or change primary / preferred dns server.

- Second line is to add secondary / alternate dns server.

- Change "Local Area Connection" with your machine's interface name.To find the name of interface use the following command :

netsh interface show interface

or

netsh interface ipv4 show config

If you want to set obtain DNS Server address automatically, use the following command :

netsh interface ipv4 set dnsservers "Local Area Connection" dhcp

Wednesday, March 31, 2021

Run Batch File invisibly

 If you want to run batch file invisibly ( no command prompt windows displayed ) , follow the following steps :

1. Copy the following lines to Notepad :

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "C:\Batch Files\test.bat" & Chr(34), 0
Set WshShell = Nothing

Note : 
- "C:\Batch Files\test.bat" : Change the path of the bat file. If the VBS file is in the same directory as the bat file, just type the name of the bat file . For example : test.bat

2. Save the notepad as VBS file, for example : invisible_launcher.vbs

3. Double click to run the invisible_launcher.vbs file.

4. If you want to convert the vbs file to exe ( executable file ) , download this program Vbs to Exe Converter

5. Extract the zip file, run Vbs_To_Exe.exe in Portable folder. Click open and choose the vbs file, then click convert button and type the name you want for the exe file.

Thursday, April 9, 2020

How to prevent Arp Poisoning

To prevent your devices from Arp poisoning like Netcut, you must add static arp in your devices and gateway router. If you only set static arp in your devices but not in your router or vice versa, the poisoning will still occur on your devices.
- To add static arp on windows 7/8/10, run cmd as administrator then type and change the following command parameter according to your network setting.

netsh interface ipv4 set neighbors "Local Area Connection" 192.168.10.1 63-d1-54-07-f5-f9 store=persistent
Note :
Local Area Connection is the name of your ethernet devices. 
192.168.10.1 is the ip address of your gateway.
63-d1-54-07-f5-f9 is MAC address of your gateway

 - Type arp -a to check if  the arp entry we entered before has been changed to static.

- To delete the static arp, use this command :
netsh interface ipv4 delete neighbors "Local Area Connection" 192.168.10.1 63-d1-54-07-f5-f9

Friday, November 8, 2019

Create batch file to check if a process is running and run it hidden

If you want to check if a process is running for specified time and if doesn't run you want to make it start automatically. Here's what you're gonna do :

1. First make a batch file, copy paste these scripts and do some modification depending on your needs :

@echo off
tasklist /FI "imagename eq smartbillingclient.exe" 2>NUL | find /I /N "no tasks are running">NUL
if "%errorlevel%"=="0" (
    start "" "d:\new folder\smartbillingclient.exe"
) else (
    echo Task Found
)
exit

Note :
- smartbillingclient.exe is the name of the process you want to check
- "d:\new folder\smartbilling.exe" is the full path of the process 
- You can change "echo Task Found" with "exit" command

2. Make a schedule for the batch file in task scheduler, just type taskschd.msc in run box.

3. Then create basic task by clicking "Create Basic Task.." in right side panel.

Monday, November 4, 2019

Change wallpaper with batch command

Create a new batch file, copy paste these commands into it then save it :

@echo off
REG ADD "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallPaper /f /t REG_SZ /d "D:\test\test.png"
REG ADD "HKEY_CURRENT_USER\Control Panel\Desktop" /v WallpaperStyle /f /t REG_SZ /d 5
RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters

Note :
- Change "D:\test\test.png" with your image path.