Rank: Newbie
Groups: Approved
Joined: 4/16/2020(UTC) Posts: 7
|
1. How to set the working directory? (I can find it in sp, but not in sp.net) 2. How to elevated a program?
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 Location: Tampa, FL Thanks: 28 times Was thanked: 416 time(s) in 354 post(s)
|
1.Code://Show current working directory
let currDir = clr.System.IO.Directory.GetCurrentDirectory();
sp.MessageBox(currDir, "Current Directory");
//Set new working directory
clr.System.IO.Directory.SetCurrentDirectory("C:\\Temp");
//Show new working directory
currDir = clr.System.IO.Directory.GetCurrentDirectory();
sp.MessageBox(currDir, "Current Directory");
2.Code:// runas is the important part here, that verb triggers the elevation (UAC prompt)
sp.RunProgram("notepad.exe", "", "runas", "normal", true, false, false);
|
|
|
|
Rank: Newbie
Groups: Approved
Joined: 4/16/2020(UTC) Posts: 7
|
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close