Quick Search


Tibetan singing bowl music,sound healing, remove negative energy.

528hz solfreggio music -  Attract Wealth and Abundance, Manifest Money and Increase Luck



 
Your forum announcement here!

  Free Advertising Forums | Free Advertising Board | Post Free Ads Forum | Free Advertising Forums Directory | Best Free Advertising Methods | Advertising Forums > Post Your Free Ads Here in English for Advertising .Adult and gambling websites NOT accepted. > Other

Other Post anything that does not fit in the above categories here.

Reply
 
Thread Tools Display Modes
Old 03-12-2011, 05:30 PM   #1
shishang82
Major
 
Join Date: Mar 2011
Posts: 646
shishang82 is on a distinguished road
Default buy office 2010 upgrade key Running a Command as A

We received a query another day from anyone who was by using the Shell operate in VBA to run a command in the command prompt. The command in question was netsh dhcp, but this could apply to any number of commands.
The unique code was as follows:
Shell "c:\windows\system32\cmd.exe /k netsh –c dhcp"
This code had worked for a while, but on Windows Server 2008 (and presumably Windows Vista and Windows 7), this command requires elevated permissions. There are likely a few ways to do this, but we’ll look at the runas command to make this work.
The runas command allows you to start a process as another user. For our purposes, the syntax is something like:
RUNAS /user: program
To run netsh by using the runas command, you could change the code as follows:
Shell "runas /user:administrator ""c:\windows\system32\cmd.exe /k netsh –c dhcp"""
This will launch a command window and prompt you for the administrator password in the command window itself.
Another way to do this is to use "runas" as the verb for the ShellExecute API operate as follows:
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
  (ByVal hWnd As Long,microsoft office Home And Student 2010 product key, _
   ByVal lpOperation As String,office Standard 2010 64bit key, _
   ByVal lpFile As String, _
   ByVal lpParameters As String, _
   ByVal lpDirectory As String, _
   ByVal nShowCmd As Long) As Long
Sub RunAsAdmin()
    Const SW_NORMAL As Long = 1
    ShellExecute hWndAccessApp(), _
                 "runas", _
                 "c:\windows\system32\cmd.exe", _
                 "/k netsh -c dhcp",microsoft office Home And Business 2010 x86 key, _
                 "c:\windows\system32",buy office 2010 upgrade key, SW_NORMAL
End Sub
When you run the RunAsAdmin procedure,office 2010 pro x86 key, you should be prompted by Windows to run the specified command.
shishang82 is offline   Reply With Quote

Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On


All times are GMT. The time now is 10:08 PM.

 

Powered by vBulletin Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Free Advertising Forums | Free Advertising Message Boards | Post Free Ads Forum