Alright, I have created a little application to reset the Windows 7 rearm count. However, it's untested and I don't want to have to clean install. So, I would like if some of you guys could test it out? And if you see any bugs, report them and I'll try to fix them. The file will be attached. Thanks in advance. (Oh, and if this is the wrong section, correct me please and I'll move this thread .) Source: Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Principal; using System.Security.AccessControl; using System.Diagnostics; using System.IO; using System.ServiceProcess; using ProcessPrivileges; namespace ConsoleApplication1 { class Program { /// <summary> /// This program will reset the Windows 7 rearm count back to defualt. /// </summary> static void Main(string[] args) { //Use higher privilegs. using (new ProcessPrivileges.PrivilegeEnabler(Process.GetCurrentProcess(), Privilege.TakeOwnership)) { //Display intro. Console.WriteLine("Welcome to W7R4E (Windows 7 Rearm 4 Ever)! This will reset your rearm count to default. You can use this as many times as you wish."); Console.WriteLine(""); //Ask the user if they wish to continue. Ask: Console.WriteLine("Would you like to continue? <Y/N>:"); Console.WriteLine(""); //Get the answer as a string. var Answer = Console.ReadLine(); //If the answer is yes... if (Answer == "Y") { //Create a new service controler. ServiceController sc = new ServiceController(); sc.ServiceName = "sppsvc"; //Get the service status as a string. var scStaus = sc.Status.ToString(); //If the service is running... if (scStaus == "Running") { //Stop the service, sc.Stop(); //Get the current windows identiy. using (var user = WindowsIdentity.GetCurrent()) { //Take ownership of the directory. var dOwnership = new DirectorySecurity(); dOwnership.SetOwner(user.User); Directory.SetAccessControl("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform", dOwnership); //Get access to the directory. var dAcces = new DirectorySecurity(); dAcces.AddAccessRule(new FileSystemAccessRule(user.User, FileSystemRights.FullControl, AccessControlType.Allow)); Directory.SetAccessControl("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform", dAcces); //Take ownership of the file. var Ownership = new FileSecurity(); Ownership.SetOwner(user.User); File.SetAccessControl("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform/tokens.dat", Ownership); //Get access to the file. var Access = new FileSecurity(); Access.AddAccessRule(new FileSystemAccessRule(user.User, FileSystemRights.FullControl, AccessControlType.Allow)); File.SetAccessControl("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform/tokens.dat", Access); } //Get the user's folder as a string. string UP = Environment.GetEnvironmentVariable("USERPROFILE"); string NewUP = UP.Replace("\\", "/"); //Get the file info and move the file. FileInfo fi = new FileInfo("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform/tokens.dat"); fi.MoveTo(NewUP + "/Desktop"); //Get the current windows identiy again. using (var user = WindowsIdentity.GetCurrent()) { //Take ownership of the directory var dOwnership = new DirectorySecurity(); dOwnership.SetOwner(user.User); Directory.SetAccessControl("C:/Windows/System32", dOwnership); //Get access to the directory. var dAccess = new DirectorySecurity(); dAccess.AddAccessRule(new FileSystemAccessRule(user.User, FileSystemRights.FullControl, AccessControlType.Allow)); Directory.SetAccessControl("C:/Windows/System32", dAccess); } //Get the new files. string[] FilePaths = Directory.GetFiles("C:/Windows/Systsm32", "*.C7483456-A289-439d-8115-601632D005A0"); //For each of the new files... foreach (string FileName in FilePaths) { //Get the current windows identity again. using (var user = WindowsIdentity.GetCurrent()) { //Take ownership of the file. var Ownership = new FileSecurity(); Ownership.SetOwner(user.User); File.SetAccessControl(FileName, Ownership); //Get access to the file. var Access = new FileSecurity(); Access.AddAccessRule(new FileSystemAccessRule(user.User, FileSystemRights.FullControl, AccessControlType.Allow)); File.SetAccessControl(FileName, Access); //Get the info and move it to the desktop. FileInfo fii = new FileInfo(FileName); fii.MoveTo(NewUP + "/Desktop"); } } //Start the service sc.Start(); //Start slmgr /dlv. Process.Start("cscript.exe C:/Windows/System32/slmgr.vbs -dlv"); //Stop the service. sc.Stop(); //Get the current windows identity again. using (var user = WindowsIdentity.GetCurrent()) { //Take ownership of the file. var Ownership = new FileSecurity(); Ownership.SetOwner(user.User); File.SetAccessControl("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform/tokens.dat", Ownership); //Get access to the file. var Access = new FileSecurity(); Access.AddAccessRule(new FileSystemAccessRule(user.User, FileSystemRights.FullControl, AccessControlType.Allow)); File.SetAccessControl("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform/tokens.dat", Access); } //Overwrites the old file and deletes the backup. File.Copy(NewUP + "/Desktop/tokens.dat", "C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform/tokens.dat", true); File.Delete(NewUP + "/Desktop/tokens.dat"); //For each of the new files... foreach (string FileName in FilePaths) { //Get the current windows identity again. using (var user = WindowsIdentity.GetCurrent()) { //Take ownership of the file. var Ownership = new FileSecurity(); Ownership.SetOwner(user.User); File.SetAccessControl(FileName, Ownership); //Get access to the file. var Access = new FileSecurity(); Access.AddAccessRule(new FileSystemAccessRule(user.User, FileSystemRights.FullControl, AccessControlType.Allow)); File.SetAccessControl(FileName, Access); } } //A bool so the foreach knows what to name each file. bool FirstFile = false; //Get the files. string[] NewFilePath = Directory.GetFiles(NewUP + "/Desktop", "*.C7483456-A289-439d-8115-601632D005A0"); //Foreach of the files on the desktop... foreach (string FileName in NewFilePath) { //If first file = false... if (FirstFile == false) { //Replace and delete the file. File.Copy(FileName, "C:/Windows/System32/7B296FB0-376B-497e-B012-9C450E1B7327-5P-0.C7483456-A289-439d-8115-601632D005A0", true); File.Delete(FileName); //Set first file to true. FirstFile = true; } else { //Replace and delete the file. File.Copy(FileName, "C:/Windows/System32/7B296FB0-376B-497e-B012-9C450E1B7327-5P-1.C7483456-A289-439d-8115-601632D005A0", true); File.Delete(FileName); } } Ask2: //Ask the user what OS of Windows 7 they are running on. Console.Clear(); Console.WriteLine("What OS of Windows 7 are you running on?"); Console.WriteLine("<U = Ultimate | P = Professional | HP = Home Premimum | HB = Home Basic | S = Starter>"); Console.WriteLine(""); //Get the answer as a string. var Answer2 = Console.ReadLine(); ///Should I be doing it like this? Process.Start("cscript.exe C:/Windows/System32/slmgr.vbs","-ipk D4F6K-QK3RD-TMVMJ-BBMRX-3MBMV"); //If the answer is U... if (Answer2 == "U") { //Install the product key and finish. Process.Start("cscript.exe C:/Windows/System32/slmgr.vbs -ipk D4F6K-QK3RD-TMVMJ-BBMRX-3MBMV"); Finish(); } //If the answer is P... else if (Answer2 == "P") { //Install the product key and finish. Process.Start("cscript.exe C:/Windows/System32/slmgr.vbs -ipk HYF8J-CVRMY-CM74G-RPHKF-PW487"); Finish(); } //If the answer is HP... else if (Answer2 == "HP") { //Install the product key and finish. Process.Start("cscript.exe C:/Windows/System32/slmgr.vbs -ipk RHPQ2-RMFJH-74XYM-BH4JX-XM76F"); Finish(); } //If the answer is HB... else if (Answer2 == "HB") { //Install the product key and finish. Process.Start("cscript.exe C:/Windows/System32/slmgr.vbs -ipk YGFVB-QTFXQ-3H233-PTWTJ-YRYRV"); Finish(); } //If the answer is S... else if (Answer2 == "S") { //Install the product key and finish. Process.Start("cscript.exe C:/Windows/System32/slmgr.vbs -ipk 7Q28W-FT9PC-CMMYT-WHMY2-89M6G "); Finish(); } //Else if the answer is invalid... else { //Diplay error. Console.WriteLine(""); Console.WriteLine("Invalid answer."); goto Ask2; } } //If the service is not running... else { //Display error. Console.WriteLine(""); Console.WriteLine("Your Software Protection Service is not running. Please start it and reboot your computer before you run this again."); Console.Read(); } } //If the answer is no... else if (Answer == "N") { //Close out } //If there is an invalid answer... else { //Display error and ask again. Console.WriteLine("Invalid answer."); Console.WriteLine(""); goto Ask; } } } public static void Finish() { //Clear the console and display the finishing message. Console.Clear(); Console.WriteLine("Congratulations! Your Windows 7 rearm count has been reset. Your computer needs to reboot before you can rearm again."); Console.WriteLine("Press any key to reboot..."); Console.Read(); //Reboot the computer. Process.Start("shutdown.exe /g /t 0"); } } }
Why, because you only have 4 or 5 rearms. (Depending on the service pack) Once you use all of the rearms, you can't rearm again. This resets that count so you can rearm again and again without worry.
Good source, testing on VM shortly... I've used slui dll injection for this, not tested file-moding... Thanks ...
I'm so glad someone appreciates this How does that work... It worked fine in my Visual Studio when I debugged it This fixes it for me... I'm not sure about you. Code: string[] FilePaths = Directory.GetFiles("C:/Windows/System32","*.C7483456-A289-439d-8115-601632D005A0"); EDIT: That could is exactly the same, other than the variable. You should tell me what throws the error, because I don't know. I want more feedback from you after you test it
See red line Code: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Security.Principal; using System.Security.AccessControl; using System.Diagnostics; using System.IO; using System.ServiceProcess; using ProcessPrivileges; namespace ConsoleApplication1 { class Program { /// <summary> /// This program will reset the Windows 7 rearm count back to defualt. /// </summary> static void Main(string[] args) { //Use higher privilegs. using (new ProcessPrivileges.PrivilegeEnabler(Process.GetCurrentProcess(), Privilege.TakeOwnership)) { //Display intro. Console.WriteLine("Welcome to W7R4E (Windows 7 Rearm 4 Ever)! This will reset your rearm count to default. You can use this as many times as you wish."); Console.WriteLine(""); //Ask the user if they wish to continue. Ask: Console.WriteLine("Would you like to continue? <Y/N>:"); Console.WriteLine(""); //Get the answer as a string. var Answer = Console.ReadLine(); //If the answer is yes... if (Answer == "Y") { //Create a new service controler. ServiceController sc = new ServiceController(); sc.ServiceName = "sppsvc"; //Get the service status as a string. var scStaus = sc.Status.ToString(); //If the service is running... if (scStaus == "Running") { //Stop the service, sc.Stop(); //Get the current windows identiy. using (var user = WindowsIdentity.GetCurrent()) { //Take ownership of the directory. var dOwnership = new DirectorySecurity(); dOwnership.SetOwner(user.User); Directory.SetAccessControl("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform", dOwnership); //Get access to the directory. var dAcces = new DirectorySecurity(); dAcces.AddAccessRule(new FileSystemAccessRule(user.User, FileSystemRights.FullControl, AccessControlType.Allow)); Directory.SetAccessControl("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform", dAcces); //Take ownership of the file. var Ownership = new FileSecurity(); Ownership.SetOwner(user.User); File.SetAccessControl("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform/tokens.dat", Ownership); //Get access to the file. var Access = new FileSecurity(); Access.AddAccessRule(new FileSystemAccessRule(user.User, FileSystemRights.FullControl, AccessControlType.Allow)); File.SetAccessControl("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform/tokens.dat", Access); } //Get the user's folder as a string. string UP = Environment.GetEnvironmentVariable("USERPROFILE"); string NewUP = UP.Replace("\\", "/"); //Get the file info and move the file. FileInfo fi = new FileInfo("C:/Windows/ServiceProfiles/NetworkService/AppData/Roaming/Microsoft/SoftwareProtectionPlatform/tokens.dat"); fi.MoveTo(NewUP + "/Desktop"); //Get the current windows identiy again. using (var user = WindowsIdentity.GetCurrent()) { //Take ownership of the directory var dOwnership = new DirectorySecurity(); dOwnership.SetOwner(user.User); Directory.SetAccessControl("C:/Windows/System32", dOwnership); //Get access to the directory. var dAccess = new DirectorySecurity(); dAccess.AddAccessRule(new FileSystemAccessRule(user.User, FileSystemRights.FullControl, AccessControlType.Allow)); Directory.SetAccessControl("C:/Windows/System32", dAccess); } //Get the new files. string[] FilePaths = Directory.GetFiles("C:/Windows/Systsm32", "*.C7483456-A289-439d-8115-601632D005A0");
Oh my gosh. I feel so stupid right now. Systsm32 ~= System32 Spelling mistake on my part. Once you fix that (or if you already have), can you tell me if it works? Thank you so much
Ok, there is still detect and install the trial key compatible with version [ works on all 6.1 W7/Servers edition ... ]
Still waiting to understand the approach with this With outside windows rearm reset you have to enter key when back into windows or it will say status not available in system properties I would love to help but don't know what to do?
The detection in C# is easy, but: Code: if ((Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "ProductName", null) != null)) { string OSVersion = (string)Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", "ProductName", null); } void PkeyDetector() { //add all supported trial keys string trkey == null; if (OSVersion == "Windows 7 Ultimate") trkey = "D4F6K-QK3RD-TMVMJ-BBMRX-3MBMV"; if (OSVersion == "Windows 7 Ultimate E") trkey "TWMF7-M387V-XKW4Y-PVQQD-RK7C8"; if (trkey = null) Object.text == "Compatible OS Not detected" //PSPSPS..... } Process.Start("cscript.exe slmgr -ipk " + trkey) //end of the code
Not quite sure what you mean timesurfer. Summary: They enter Y. It stops the sppscv and cuts the big file extension files and tokens.dat. It starts the service, does slmgr /dlv to create new tokens.dat and the other files. It then stops the service again and replaces the files, then it installs the default product key for which ever OS the enter. If your talking about the error, I just had a spelling mistake. It's supposed to be System32 and not Systsm32 EDIT: I'm late. Didn't see the next page. All I really want to know, is if this works or not. If it doesn't I can fix it or have you guys help me fix it. I'm getting confused by your conversation. I'm going to sit back and watch this progress... (I hope)
Hmm? That's confusing. I just have the user enter their OS and it installs the default product key based on the user input. Right now I just want to know if it works
So this is PMR's attempt to backup/restore status I thought you we're deleting WPA inside windows to reset rearms not just copy current status, which could be 1-5 rearms restore although if an actual backup/restore program existed like I think your doing you would only need 1 rearm like IORRT but if people we're empty regarding rearms this won't work correct? Did I get that correct?
Automatic backup/restore not WPA delete correct hence it relies on current status like PMR's did Assuming I'm correct cause I can't read that #C too well what we want in an perfect rearm method is to delete the WPA inside windows I've been wanting this inside WPA delete methods for almost 1.5 linear years but with no go So with all due respect thread title needs changing since it doesn't actually reset but restore
I'm not referring to you, I referred to my code that I posted for him: And this tool doesn't load WPA Concept, any mod the WPA files to reset rearms, this is app is based on this, see it: http://forums.mydigitallife.net/thr...rm-count-run-Windows-7-Forever-without-cracks
Yes, this is PAYMYRENT's method of reseting the rearm count back to default. I just compiled it into a program.
lol...I just posted that link. Remember JC I did the rearm concept so I know who's done what I was there. Read the thread I'm there...lol But still re-read my last post I have edit He already put into program...lol I remember an earlier post in the coding forum post saying you we're trying new thing but it isn't new So the title is incorrect it doesn't reset it restores And again it restores from current status which I'm guessing would require both minimum 1 rearm atleast Cody help me explain...lol