My Problem
I have an Internet connection in my house and many of my friends come over everyday and always want to use my notebook to access the Internet.
I don't want to be mean and tell them no that they cannot use my notebook to browse the Internet so often as this may have negative consequences with my friendships with these people.
I would like to disrupt their experience remotely from my Android phone connected to the same local network as the Windows machine someway in a secretive manner.
My Idea
I have software on my Android phone, and I setup a shared folder on the Windows 7 machine and confirmed I can create and delete files in this location from my Android when connected on the same network.
I need a way to utilize this shared folder and trigger some sort of task or batch script on the Windows machine from my Android as needed that will disrupt the network of my notebook.
If I can get the network on the notebook to be disrupted or something then this would trick people into thinking the notebook doesn't work very well at all and they'd stop asking to use so often.
Question
I already know how to make a batch file that makes a computer freeze but I'm not sure where to start to trigger a batch script or something to run on the Windows machine with the shared folder access I have from the Android to create and delete files. Any way to help make this task possible?
Best Answer
Since you say you already have a solution to access a shared folder from your Android phone and confirmed you can access it and delete files, I'll give you the steps to take to setup a batch script on the Windows machine that will simply check for a file there and then take an action based on the conditional IF logic.
You will need to use Task Scheduler and use specific settings to ensure the process runs in a hidden manner so it's not visible on the screen when the batch script is executed.
If you want to disable the Network Adapter remotely, connect to the shared folder with your Android phone and simply delete the file. Now every time the batch script is executed it'll disable that NIC.
Prerequisite - Time for some detective work
Get the name of the [interface] Network Adapter you wish to disable by running this in an admin elevated command prompt:
netsh interface show interface
. Take note of the "Interface Name" of the network adapter which you wish to disable via command line with the batch script.I will disable the "Ethernet" named adapter in the examples I provide. You will obviously need to replace this value with the applicable name of the interface in your environment to disable.
Batch Script to Schedule
Be sure to set the values of the
SET Folder=
andSET File=
to equal the valid folder path and file name that the batch file will check whether or not it exists with the conditional IF logic.Be sure to also set the value of the
SET IntName=
to be the value of the Interface Name of the network adapter the batch script will disable.Example Script (zDisableNic.cmd)
You can keep a small batch file in a (or the same) folder if you want to right-click on and select run as administrator to enable the NIC manually quickly as you need to.
Once you create the
start.txt
file to ensure the other batch file does not disable the NIC, you then right-click and run as administrator on the EnableNic batch script.Example Script (zEnableNIC.cmd)
Task Scheduler
From Windows
Task Scheduler
on the jobProperties
(See below Print Screens)1. In the
General
tab, ensure that the below options are select/checked or unchecked just as shown in the Print Screen "General"Run only when user is logged on
Run whether user is logged on or not
Run with the highest privileges
2. In the
Triggers
tab, ensure that the below options are set just as specified and shown in the Print Screen "Triggers"On a schedule
One time
every 1 minutes
for a duration of
indefinitely
Check
Wake the computer to run this task
3. In the
Action
tab, clickEdit
, and ensure that the below options are set just as specified and shown in the Print Screen "Action"the
Program/script
value should be the the full path where the batch script is located without a final backslash "\
" but with double quotes around itthe
Start in (optional)
value should be set just as shown in the below example—do not put double quote marks around this value though4. Once you press
OK
(maybe twice) you will be prompted for a credential as shown in Print Screen "Credential"service
on my machine and gave it a strong password, ensured the account was enabled, was set with a password that never expires, and was a local administrator on the machine—you can tighten down more granular I'm sure if needed—and this is the credential I used herePrint Screens
General
Triggers
Action
Credential
Further Resources