March 3, 200719 yr Working perfect...please add the script to rename the file for backup purpose well.. as for previous one..B)Here it is, just drag and drop the original file on the script, it'll modify permissions for the original file and make another copy of the same file in source directory..Thank You gunsmokingman! Dim Act : Set Act = CreateObject("Wscript.Shell")Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")Dim File1, File2For Each File1 in Wscript.Arguments Act.Run("takeown /A /f " & Chr(34) & File1 & chr(34)),1,True Act.Run("icacls " & Chr(34) & File1 & chr(34) & " /grant administrators:F"),1,TrueFile2 = Split(File1,".")Set File = Fso.GetFile(File1)File.Copy(File2(0) & "_Original." & File2(1))NextBTW, how can I add now this new script to my right click selection?
March 3, 200719 yr Working perfect...please add the script to rename the file for backup purpose well.. as for previous one..B)Here it is, just drag and drop the original file on the script, it'll modify permissions for the original file and make another copy of the same file in source directory..Thank You gunsmokingman! Dim Act : Set Act = CreateObject("Wscript.Shell")Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")Dim File1, File2For Each File1 in Wscript.Arguments Act.Run("takeown /A /f " & Chr(34) & File1 & chr(34)),1,True Act.Run("icacls " & Chr(34) & File1 & chr(34) & " /grant administrators:F"),1,TrueFile2 = Split(File1,".")Set File = Fso.GetFile(File1)File.Copy(File2(0) & "_Original." & File2(1))NextBTW, how can I add now this new script to my right click selection?I have made this new script into a sfx fle that extracts to the Sendto folder,this one does not create a extra copy of the fileSave As OwnTheFile_V2Dim Act : Set Act = CreateObject("Wscript.Shell")Dim File1For Each File1 in Wscript.Arguments Act.Run("takeown /A /f " & Chr(34) & File1 & chr(34)),1,True Act.Run("icacls " & Chr(34) & File1 & chr(34) & " /grant administrators:F"),1,True NextI have made this new script into a sfx fle that extracts to the Sendto folderSave as OwnTheFile_V3Dim Act : Set Act = CreateObject("Wscript.Shell")Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")Dim File, File1, File2For Each File1 in Wscript.Arguments Act.Run("takeown /A /f " & Chr(34) & File1 & chr(34)),0,True Act.Run("icacls " & Chr(34) & File1 & chr(34) & " /grant administrators:F"),0,TrueFile2 = Split(File1,".")Set File = Fso.GetFile(File1)File.Copy(File2(0) & "_Original." & File2(1))NextOwnTheFile_V3.exeOwnTheFile_V2.exe
March 3, 200719 yr wooo something i was looking for, hmm isit there anyway you can take over everyfile because that would save time an effort in a sense
March 3, 200719 yr wooo something i was looking for, hmm isit there anyway you can take over everyfile because that would save time an effort in a senseThis can do multiple files, but there is a limit to how many the Wscript.Arguments can handle.I believe it can handle under 24 files at a time, but do not quote me on that.
March 3, 200719 yr Author Yesss, it is working great with every files i have checked till now..if problem persist.. rectification will obviously be doneThanks Gunsmokingman for his effort for making the VBS script for sendto menu.
March 4, 200719 yr Author now you can take ownership with the registry fileWindows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\*\shell\runas]@="Gain Ownership""Extended"="""NoWorkingDirectory"=""[HKEY_CLASSES_ROOT\*\shell\runas\command]@="cmd.exe /c takeown /A /f \"%1\" && icacls \"%1\" /grant administrators:F""IsolatedCommand"="cmd.exe /c takeown /A /f \"%1\" && icacls \"%1\" /grant administrators:F"[HKEY_CLASSES_ROOT\Directory\shell\runas]@="Gain Ownership""Extended"="""NoWorkingDirectory"=""[HKEY_CLASSES_ROOT\Directory\shell\runas\command]@="cmd.exe /c takeown /A /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t""IsolatedCommand"="cmd.exe /c takeown /A /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"SHIFT + Right Click = Gain Ownership context menuownership.reg Edited March 4, 200719 yr by Nepali
March 4, 200719 yr now you can take ownership with the registry fileWhat this reg entry gives us, right click option to take ownership or?Thx
March 4, 200719 yr Author merging this, you will get option to gain ownership for files and folderSHIFT + Rt click Edited March 4, 200719 yr by Nepali
March 21, 200719 yr Working perfect...please add the script to rename the file for backup purpose well.. as for previous one..B)Here it is, just drag and drop the original file on the script, it'll modify permissions for the original file and make another copy of the same file in source directory..Thank You gunsmokingman! Dim Act : Set Act = CreateObject("Wscript.Shell")Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")Dim File1, File2For Each File1 in Wscript.Arguments Act.Run("takeown /A /f " & Chr(34) & File1 & chr(34)),1,True Act.Run("icacls " & Chr(34) & File1 & chr(34) & " /grant administrators:F"),1,TrueFile2 = Split(File1,".")Set File = Fso.GetFile(File1)File.Copy(File2(0) & "_Original." & File2(1))NextBTW, how can I add now this new script to my right click selection?I have made this new script into a sfx fle that extracts to the Sendto folder,this one does not create a extra copy of the fileSave As OwnTheFile_V2Dim Act : Set Act = CreateObject("Wscript.Shell")Dim File1For Each File1 in Wscript.Arguments Act.Run("takeown /A /f " & Chr(34) & File1 & chr(34)),1,True Act.Run("icacls " & Chr(34) & File1 & chr(34) & " /grant administrators:F"),1,True NextI have made this new script into a sfx fle that extracts to the Sendto folderSave as OwnTheFile_V3Dim Act : Set Act = CreateObject("Wscript.Shell")Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject")Dim File, File1, File2For Each File1 in Wscript.Arguments Act.Run("takeown /A /f " & Chr(34) & File1 & chr(34)),0,True Act.Run("icacls " & Chr(34) & File1 & chr(34) & " /grant administrators:F"),0,TrueFile2 = Split(File1,".")Set File = Fso.GetFile(File1)File.Copy(File2(0) & "_Original." & File2(1))Nexti get a permissions error when i try to run and i'm not sure how to force it to run as admin (or whatever permissions are needed)now you can take ownership with the registry fileWindows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\*\shell\runas]@="Gain Ownership""Extended"="""NoWorkingDirectory"=""[HKEY_CLASSES_ROOT\*\shell\runas\command]@="cmd.exe /c takeown /A /f \"%1\" && icacls \"%1\" /grant administrators:F""IsolatedCommand"="cmd.exe /c takeown /A /f \"%1\" && icacls \"%1\" /grant administrators:F"[HKEY_CLASSES_ROOT\Directory\shell\runas]@="Gain Ownership""Extended"="""NoWorkingDirectory"=""[HKEY_CLASSES_ROOT\Directory\shell\runas\command]@="cmd.exe /c takeown /A /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t""IsolatedCommand"="cmd.exe /c takeown /A /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"SHIFT + Right Click = Gain Ownership context menuThis doesnt allow for gaining of ownership of executeables
March 21, 200719 yr I used this script to change the permission on mspaint.exeDim Act : Set Act = CreateObject("Wscript.Shell")Dim Fso : Set Fso = CreateObject("Scripting.FileSystemObject") Dim File, File1, File2 For Each File1 in Wscript.Arguments Act.Run("takeown /f " & File1),0,True Act.Run("icacls " & File1 & " /grant administrators:F"),1,True File2 = Split(File1,".") Set File = Fso.GetFile(File1) File.Copy(File2(0) & "_Original." & File2(1)) NextThe other scripts I posted where to change permission in the Program Files because of the space in the name.Before OwnTheFileAfter OwnTheFile
May 8, 200719 yr I was wondering if anyone can help me with this unkown user?I would like to remove it if I could, I am the only user on this computer and the guest account is disabled.Should I run a script to take ownership of "everything" ? Edited May 8, 200719 yr by kartel
November 14, 200817 yr Hello,Can this script be used to open an encrypted file,if yes how to do that.
Create an account or sign in to comment