{"id":14200,"date":"2021-12-14T11:21:46","date_gmt":"2021-12-14T11:21:46","guid":{"rendered":"https:\/\/lgildv5i97.onrocket.site\/answers\/?post_type=question&#038;p=14200"},"modified":"2021-12-14T11:22:47","modified_gmt":"2021-12-14T11:22:47","slug":"runas-from-network-drive","status":"publish","type":"question","link":"https:\/\/computing.net\/answers\/programming\/runas-from-network-drive\/21984.html","title":{"rendered":"Runas From Network Drive"},"content":{"rendered":"<p>I thought I could make a simple, one-line script to add the current user to the local admins group:<\/p>\n<p>runas \/env \/user:administrator &#8220;net localgroup administrators \/add %USERDOMAIN%\\%USERNAME%&#8221;<\/p>\n<p>&#8230;but it doesn&#8217;t work when run from a network drive because Administrator doesn&#8217;t have the drive mapped, so I get a &#8220;directory name is invalid&#8221; error. Which is annoying, because if I run it from a UNC path, it would self-correct to %WINDIR%.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"inline_featured_image":false,"iawp_total_views":6},"question-category":[55],"question_tags":[],"class_list":["post-14200","question","type-question","status-publish","hentry","question-category-programming"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question\/14200","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question"}],"about":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/types\/question"}],"author":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/comments?post=14200"}],"wp:attachment":[{"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/media?parent=14200"}],"wp:term":[{"taxonomy":"question-category","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question-category?post=14200"},{"taxonomy":"question_tags","embeddable":true,"href":"https:\/\/computing.net\/answers\/wp-json\/wp\/v2\/question_tags?post=14200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}