如何在使用者登入windows時自動執行具有管理員許可權的程式?

有時,您希望或需要一個程式在登入到Windows後立即以提升的許可權自動執行,但如何設定這樣的程式?今天的超級使用者問答帖子對一個沮喪的讀者有一些有用的建議。...

如何在使用者登入windows時自動執行具有管理員許可權的程式?

有時,您希望或需要一個程式在登入到Windows後立即以提升的許可權自動執行,但如何設定這樣的程式?今天的超級使用者問答帖子對一個沮喪的讀者有一些有用的建議。

今天的問答環節是由SuperUser提供的,SuperUser是Stack Exchange的一個分支,是一個由社群驅動的問答網站分組。

由Acid Pix(Flickr)提供的螢幕截圖。

問題

超級使用者讀者Frederick Zhang想知道如何在使用者登入時自動執行具有管理員許可權的程式:

I am using Windows 8.1 (64-bit) and I would like to automatically run a program with administrator privileges upon user login.

I tried to make a shortcut of the program and ticked the run as administrator check box in the properties of the program shortcut itself, then tried placing the shortcut in the two locati*** shown below, but ticking the box just made it invalid.

  • C:\Users\MyUser\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
  • C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp

Then I edited the program using Resource Hacker to modify its manifest so that administrator privileges were required to run this program. This also made shortcuts under start up directories invalid. After that, I tried to add the program to the following location as well, but it did not work, either.

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

How can I automatically run a program with administrator privileges on user login?

如何在使用者登入時自動執行具有管理員許可權的程式?

答案

超級使用者貢獻者Syberdoor為我們提供了答案:

The best way to do this (and the only simple way if you not only want this to run with administrator privileges, but also without UAC prompts) is by creating a scheduled task. With a scheduled task, you can specify which user you want to run it under and that it should run with the highest privileges.

This is probably what you really want because the check box button run as administrator in shortcut properties does trigger UAC prompts rather than really using an administrative user. If you also specify a trigger as on user logon, it should have the same effect as using the startup or run key.

Alternatively, you can use run as with the save credentials option to store the password of another user once and have it cached forever, but it does not work around UAC prompts as far as I know.


有什麼要補充的解釋嗎?在評論中發出聲音。想從其他精通技術的Stack Exchange使用者那裡瞭解更多答案嗎?在這裡檢視完整的討論主題。

  • 發表於 2021-04-10 11:36
  • 閱讀 ( 29 )
  • 分類:網際網路

你可能感興趣的文章

5個有用的vb windows指令碼,可自動使用計算機

無論您是IT分析師還是普通計算機使用者,都可能需要經常在PC上執行許多工。VB指令碼是按比例縮小的Visual Basic程式,用作Windows指令碼,可以執行任何操作,從調出有關計算機硬體的重要資訊,到停止和啟動服務或重置網路卡...

  • 發佈於 2021-03-11 20:14
  • 閲讀 ( 52 )

丟失了windows管理員密碼?下面是如何修復它

...oft禁用了內建的管理員帳戶。取而代之的是,它的特色是使用者帳戶控制,這一功能至今仍在windows10中存在。這允許您在使用任何帳戶時臨時授予管理員許可權,只要您擁有管理員的密碼。 ...

  • 發佈於 2021-03-17 22:06
  • 閲讀 ( 51 )

windows 10上的“拒絕訪問”資料夾錯誤?5個簡單的修復

...的檔案在一臺電腦上保密。只有管理員才能訪問屬於其他使用者的檔案。此外,您還需要提供管理員許可權才能對系統檔案(如ProgramFiles和Windows資料夾中的檔案)進行更改。 ...

  • 發佈於 2021-03-17 23:57
  • 閲讀 ( 52 )

如何密碼保護你的隨身碟:5個簡單的方法

想學習如何保護快閃記憶體驅動器嗎?不幸的是,你不能用密碼保護整個隨身碟。但是您可以加密分割槽、資料夾和存檔。 ...

  • 發佈於 2021-03-18 13:59
  • 閲讀 ( 45 )

在windows中以管理員身份執行任何程式的4種方法

...帳戶,它們也不會以管理員身份執行。這是由於一個名為使用者帳戶控制(UAC)的功能,它只允許您在必要時以管理員許可權執行應用程式。 ...

  • 發佈於 2021-03-19 19:32
  • 閲讀 ( 57 )

windows 10上的使用者帳戶控制和管理員許可權

...者破壞一些毫無意義的東西,這就是為什麼使用的Windows使用者帳戶的型別會有所不同。 ...

  • 發佈於 2021-03-26 12:09
  • 閲讀 ( 41 )

Windows10中開啟powershell的9種方法

...比命令提示符更加健壯和強大。這就是為什麼它成為高階使用者和it專業人士首選的指令碼語言和命令列介面,與其他類似Linux和Unix的shell競爭。 相關:PowerShell與Windows命令提示符有何不同 PowerShell是一個使用cmdlet(讀作“command-l...

  • 發佈於 2021-04-02 10:35
  • 閲讀 ( 80 )

在windows 10中建立不帶uac提示的管理員模式快捷方式

Windows10中的使用者訪問控制(UAC)提示可能很煩人,尤其是當您經常執行需要管理員許可權的程式時。謝天謝地,有一種方法可以建立一個不會提示您輸入UAC的快捷方式。 此技巧的工作原理是設定一個計劃任務,以便在管理員...

  • 發佈於 2021-04-02 15:25
  • 閲讀 ( 41 )

如何刪除windows密碼

...議,卻沒有注意到其中涉及的重要風險。 如何刪除本地使用者帳戶的windows密碼 單擊“開始”選單,然後單擊“設定中心距”,開啟“設定”應用程式。 接下來,點選“賬戶” 從左側的設定列表中,選擇“登入選項”,然後...

  • 發佈於 2021-04-04 00:52
  • 閲讀 ( 34 )

如何在一臺電腦上使用多個dropbox帳戶

... 更煩人的方式:共享資料夾 Dropbox的一個優點是它能夠在使用者之間共享資料夾和檔案。如果您需要隨時訪問輔助帳戶上的某些內容,只需與主帳戶共享相關資料夾即可。方法如下: 登入到您的輔助帳戶上的Dropbox網站,然後單...

  • 發佈於 2021-04-06 21:28
  • 閲讀 ( 85 )
玲玲萌萌
玲玲萌萌

0 篇文章

作家榜

  1. admin 0 文章
  2. 孫小欽 0 文章
  3. JVhby0 0 文章
  4. fvpvzrr 0 文章
  5. 0sus8kksc 0 文章
  6. zsfn1903 0 文章
  7. w91395898 0 文章
  8. SuperQueen123 0 文章

相關推薦