WiFi tethering in windows7 without Admin previleges

14,352

Based on the answer to the question I asked, then what you basically need to do is to run a task with elevated privileges, but without specifying those privileges each time from a standard user account.

Well this can be done, but it's a bit of a hack :-)

Step 1

Create a batch file that will run the setup command for your wifi (In this case the netsh command in the comments above)

Place that batch file some where you can find it, preferably in your path, somewhere like c:\windows

Make sure you create the batch file as admin, using an admin account.

Step 2

Still using an admin account, find and open the windows task scheduler, usually you can type "task" into search, or find it in the control panel somewhere.

When the scheduler opens, use the options available to create a new task.

In the general tab of the task, add a name for the task, optionally a description then under security options change the user account to use, to one which has the required authentication to run the batch file you created in step 1

Also make sure to select, "Run Only when user is logged on" and check "Run with highest pivliges"

In the "Actions" tab, add a new action and set the action type as "Run a program", followed by putting in the settings the name of your batch file and any other settings needed such as parameters and run folder.

OK everything, and let the task be created. (Don't add any schedule to it)

In the task list, right click on the new task you just created, and choose run (This is to test to make sure everything runs as anticipated)

Once your happy with that, move on to ....

Step 3

Back under your normal user account, create a shortcut where ever you want to run your task from, for example on your desktop.

Do this by using the usual, right click and create new shortcut procedure.

when you get to the place to specify the path of the command to run, enter

schtasks /run /tn "<name of your task>"

So if in step 2 you called your task "wifiswitcher", then you would enter

schtasks /run /tn "wifiswitcher"

Complete the wizard, and save the shortcut.

Step 4 (Optional)

If you want to tidy things up a bit, right click on your new shortcut and under the shortcut properties, set the tun type to minimized and possibly give it a nicer Icon.

The alternative Way

If you have any experience of C# programming, then it's quite easy to create a simple command line program and in the code have it request admin privileges via the UAC system

That's the thing that pops up the "Would you like to allow X to make changes to your computer Yes/No" box.

If you choose to do it that way, then it's a simple as just using the Process class in .NET to run the required netsh command, and answer a simple yes or no button each time you click on the app.

Share:
14,352
Syam Kumar S
Author by

Syam Kumar S

Updated on September 18, 2022

Comments

  • Syam Kumar S
    Syam Kumar S over 1 year

    I need to share my internet connection using WiFi. And unfortunately I dont have administrator rights. I know how to enable hostednetwork but this requires admin rights everytime the system starts. Is there any way that I can do this?

    As a last resort, I can have administrator previleges for installing software initially but not everytime the system starts. So you can suugest any software that will not require admin previleges later for turning this feature on and off.

    • sina nazari
      sina nazari over 9 years
      You only need admin rights to set it up once. I use my HTC as a 3G modem all the time. I had to use admin initially to install driver, but from that point onwards, just plugging it in automatically enabled it.
    • Syam Kumar S
      Syam Kumar S over 9 years
      @shawty This is not the thing I want. I have a wired internet on my computer and I want share it through wifi. so that I can connect my phone/tablet to it.
    • sina nazari
      sina nazari over 9 years
      ok, and do you have a WiFi adapter/dongle on the computer in question that's capable of transmitting? If you don't then it doesn't matter what you try, your not going to succeed. Most consumer grade WiFi's that are on PC's are setup to receive only.
    • sina nazari
      sina nazari over 9 years
      Just to clarify that last comment: By transmit, I don't mean complete lack of 2 way communication, I mean does it have the ability to advertise an SID and say "Hey look at me, I'm a Base Station".
    • Syam Kumar S
      Syam Kumar S over 9 years
      Yes the computer has that hardware capability. I can run the comman netsh wlan set hostednetwork mode=allow ssid=YourSSID key=YourPassword keyusage=persistent as administrator to advertise an SID. But I should do it as administrator.
    • sina nazari
      sina nazari over 9 years
      Right, but what you want to do is to NOT have to run it as administrator. I'm guessing you want to just click on the file and have it run without having to add admin credentials each time you enable the WiFi?