tsue Posted January 22, 2011 Share Posted January 22, 2011 hello, i was wondering is autoit coding is capable of changing the propietary user of any file if it is capable, can someone point me the way, i have been searching, but nothing found thanks Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 22, 2011 Share Posted January 22, 2011 Define "changing the propietary user" of a file. I have no idea what you meant. If, by chance, it means violating licensing then you won't get help on this forum. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
tsue Posted January 22, 2011 Author Share Posted January 22, 2011 Define "changing the propietary user" of a file. I have no idea what you meant.If, by chance, it means violating licensing then you won't get help on this forum.hello, i dont think its violationg licens its more like changing privileges, manually you do it by right clicking then properties/security/advanced options/propietary(i think my windows is spanish)/then edit/ then add a propietary user like an administrator userthe main reason i want to do this is fo the viruses wich protects themself by having a diferent admin/propietary userplease dont tell me to use an antivirus, thats the easy answer for most of the people that has responded meantivirus only detects false positives and viruses in their database.thanks Link to comment Share on other sites More sharing options...
guinness Posted January 22, 2011 Share Posted January 22, 2011 Maybe RunAs() in the Help File could help you?! UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
UEZ Posted January 22, 2011 Share Posted January 22, 2011 You can use CACLS to change file permission!Br,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
tsue Posted January 24, 2011 Author Share Posted January 24, 2011 Maybe RunAs() in the Help File could help you?!hello, i tried diferent ways, but i can get it to work, well, i was wondering how do you delete with autoit(not with other programs) this kind of files that needs to change permissions Link to comment Share on other sites More sharing options...
hannes08 Posted January 24, 2011 Share Posted January 24, 2011 Hello tsue,we use the tool Subinacl from Microsoft to set the owner of files and folders:subinacl - MicrosoftRegards,Hannes Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler] Link to comment Share on other sites More sharing options...
tsue Posted January 24, 2011 Author Share Posted January 24, 2011 Hello tsue,we use the tool Subinacl from Microsoft to set the owner of files and folders:subinacl - MicrosoftRegards,Hannes hello, im stuck with the program, lets say i want to change the permisions of a file to mine, how do you do it Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 25, 2011 Share Posted January 25, 2011 hello, im stuck with the program, lets say i want to change the permisions of a file to mine, how do you do itYou are not making any sense. Several answers have already been given that will change file permissions. Exactly which permission do you want to grant/deny? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
ripdad Posted January 25, 2011 Share Posted January 25, 2011 (edited) SetACL HomePage: http://helgeklein.com/Download SetACL.exe here: http://sourceforge.net/projects/setacl/files/#RequireAdmin Local $sFile = 'C:\SomePath\SomeFile.exe' File_Unlock($sFile) Func File_Unlock($sPath) If StringInStr(FileGetAttrib($sPath), 'D') Then Return SetError(-1); can't process folder If StringInStr($sPath, '/') Then Return SetError(-2); can't process network If Not FileExists($sPath) Then Return SetError(-3); file doesn't exist Local $exe = @ScriptDir & '\SetACL.exe' If Not FileExists($exe) Then Return SetError(-4); file doesn't exist Local $cmd = $exe & ' -on "' & $sPath & '" -ot file' & _ ' -actn clear -clr "dacl,sacl"' & _ ' -actn setprot -op "dacl:np"' & _ ' -actn ace -ace "n:administrators;m:grant;p:full"' RunWait($cmd, @ScriptDir, @SW_HIDE) EndFuncAnd here is one for folder \ folder tree ...From: http://blog.bluebearr.net/2007/12/fixing-profile-permissions-in-windows.htmlFunc Path_Unlock() If Not FileExists(@ScriptDir & '\SetACL.exe') Then Return Local $sPath = FileSelectFolder('ACL File Protection - Choose Folder then Click Ok', '', 2, '') If Not $sPath Then Return Local $owner = @ComputerName & '\' & @UserName Local $SetACL_Path_Action = @ScriptDir & '\SetACL.exe -on "' & $sPath & '" -ot file -actn ' ToolTip('Stage One - Setting Owner to Administrators Group', 0, 0, 'Executing SetACL Task ...', 1) RunWait($SetACL_Path_Action & 'setowner -ownr "n:Administrators" -rec cont_obj', @ScriptDir, @SW_HIDE) ToolTip('Stage Two - Setting Full Permissions', 0, 0, 'Executing SetACL Task ...', 1) RunWait($SetACL_Path_Action & 'ace -ace "n:Administrators;p:full" -actn rstchldrn -rst dacl', @ScriptDir, @SW_HIDE) ToolTip('Stage Three - Resetting Owner', 0, 0, 'Executing SetACL Task ...', 1) RunWait($SetACL_Path_Action & 'setowner -ownr "n:' & $owner & '" -rec cont_obj', @ScriptDir, @SW_HIDE) ToolTip('') MsgBox(8256, 'SetACL - Task Completed', 'Finished') EndFunc Edited January 26, 2011 by ripdad "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
wakillon Posted January 25, 2011 Share Posted January 25, 2011 (edited) Function Set you Owner and Set you permission to Full control. Func _SetOwnerAndPerms ( $_FilePath ) Local $_SubinaclPath = @SystemDir & '\subinacl.exe' RunWait ( @ComSpec & ' /c ' & $_SubinaclPath & ' /file "' & $_FilePath & '" /setowner=' & @ComputerName & '\' & @UserName, '', @SW_HIDE ) Local $_CaclsPath = @SystemDir & '\CACLS.exe' RunWait ( @ComSpec & ' /c ' & $_CaclsPath & ' "' & $_FilePath & '" /E /G "' & @ComputerName & '\' & @UserName & '":F', '', @SW_HIDE ) EndFunc ;==> _SetOwnerAndPerms ( ) Edited January 27, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
tsue Posted January 27, 2011 Author Share Posted January 27, 2011 Function Set you Owner and Set you permission to Full control. Func _SetOwnerAndPerms ( $_FilePath ) Local $_SubinaclPath = @SystemDir & '\subinacl.exe' RunWait ( @ComSpec & ' /c ' & $_SubinaclPath & ' "' & $_FilePath & '" /setowner=' & @ComputerName & '\' & @UserName, '', @SW_HIDE ) Local $_CaclsPath = @SystemDir & '\CACLS.exe' RunWait ( @ComSpec & ' /c ' & $_CaclsPath & ' "' & $_FilePath & '" /E /G "' & @ComputerName & '\' & @UserName & '":F', '', @SW_HIDE ) EndFunc ;==> _SetOwnerAndPerms ( ) hello, im having errors trying it, i dont know why, jeje i got a little frustrated here is what i get when i make a copy of what is written in cmd C:\Users\luis>"C:\Users\luis\Desktop\change file permision\subinacl.exe" "J:\aut orune.infd" /setowner=UMI\luis WARNING : Error parsing line +:\autorune.infd /setowner=umi\luis Use : SubInacl /help to get the usage information or SubInAcl /help syntax to understand SubInAcl syntax. Elapsed Time: 00 00:00:00 Done: 0, Modified 0, Failed 0, Syntax errors 1 Last Syntax Error:WARNING : Error parsing line +:\autorune.infd /setowner=umi\lu is Link to comment Share on other sites More sharing options...
tsue Posted January 27, 2011 Author Share Posted January 27, 2011 SetACL HomePage: http://helgeklein.com/ Download SetACL.exe here: http://sourceforge.net/projects/setacl/files/ #RequireAdmin Local $sFile = 'C:\SomePath\SomeFile.exe' File_Unlock($sFile) Func File_Unlock($sPath) If StringInStr(FileGetAttrib($sPath), 'D') Then Return SetError(-1); can't process folder If StringInStr($sPath, '/') Then Return SetError(-2); can't process network If Not FileExists($sPath) Then Return SetError(-3); file doesn't exist Local $exe = @ScriptDir & '\SetACL.exe' If Not FileExists($exe) Then Return SetError(-4); file doesn't exist Local $cmd = $exe & ' -on "' & $sPath & '" -ot file' & _ ' -actn clear -clr "dacl,sacl"' & _ ' -actn setprot -op "dacl:np"' & _ ' -actn ace -ace "n:administrators;m:grant;p:full"' RunWait($cmd, @ScriptDir, @SW_HIDE) EndFunc And here is one for folder \ folder tree ... From: http://blog.bluebearr.net/2007/12/fixing-profile-permissions-in-windows.html Func Path_Unlock() If Not FileExists(@ScriptDir & '\SetACL.exe') Then Return Local $sPath = FileSelectFolder('ACL File Protection - Choose Folder then Click Ok', '', 2, '') If Not $sPath Then Return Local $owner = @ComputerName & '\' & @UserName Local $SetACL_Path_Action = @ScriptDir & '\SetACL.exe -on "' & $sPath & '" -ot file -actn ' ToolTip('Stage One - Setting Owner to Administrators Group', 0, 0, 'Executing SetACL Task ...', 1) RunWait($SetACL_Path_Action & 'setowner -ownr "n:Administrators" -rec cont_obj', @ScriptDir, @SW_HIDE) ToolTip('Stage Two - Setting Full Permissions', 0, 0, 'Executing SetACL Task ...', 1) RunWait($SetACL_Path_Action & 'ace -ace "n:Administrators;p:full" -actn rstchldrn -rst dacl', @ScriptDir, @SW_HIDE) ToolTip('Stage Three - Resetting Owner', 0, 0, 'Executing SetACL Task ...', 1) RunWait($SetACL_Path_Action & 'setowner -ownr "n:' & $owner & '" -rec cont_obj', @ScriptDir, @SW_HIDE) ToolTip('') MsgBox(8256, 'SetACL - Task Completed', 'Finished') EndFunc hello, im having trouble with the scrip here is what i get in cmd C:\Users\luis>"C:\Users\luis\Desktop\change file permision\SetACL.exe" -on "J:\a utorune.infd" -ot file -actn clear -clr "dacl,sacl" -actn setprot -op "dacl:np" -actn ace -ace "n:administrators;m:grant;p:full" SetACL finished with error(s): SetACL error message: The SID for a trustee could not be found CHANGED TO ADMINISTRADORES INSTEAD OF ADMINISTRATORS C:\Users\luis>"C:\Users\luis\Desktop\change file permision\SetACL.exe" -on "J:\a utorune.infd" -ot file -actn clear -clr "dacl,sacl" -actn setprot -op "dacl:np" -actn ace -ace "n:administradores;m:grant;p:full" INFO: Processing ACL of: <\\?\J:\autorune.infd> ERROR: Writing SD to <\\?\J:\autorune.infd> failed with: Acceso denegado. SetACL finished successfully. YUST SETTING OWNER C:\Users\luis>"C:\Users\luis\Desktop\change file permision\SetACL.exe" -on "J:\a utorune.infd" -ot file -actn setowner -ownr "n:administrators;s:luis" ERROR in command line: Invalid SID entry s:luis in a parameter option -ownr spec ified: n:administrators;s:luis! Type 'SetACL -help' for help. i dont know what else to do, and im a little confused with SID where or how do i get it thanks Link to comment Share on other sites More sharing options...
wakillon Posted January 27, 2011 Share Posted January 27, 2011 (edited) hello, im having errors trying it, i dont know why, jeje i got a little frustrated here is what i get when i make a copy of what is written in cmd C:\Users\luis>"C:\Users\luis\Desktop\change file permision\subinacl.exe" "J:\aut orune.infd" /setowner=UMI\luis WARNING : Error parsing line +:\autorune.infd /setowner=umi\luis Use : SubInacl /help to get the usage information or SubInAcl /help syntax to understand SubInAcl syntax. Elapsed Time: 00 00:00:00 Done: 0, Modified 0, Failed 0, Syntax errors 1 Last Syntax Error:WARNING : Error parsing line +:\autorune.infd /setowner=umi\lu is I forget /file argument, last post corrected. Edit : and this one for files or Directory ( with or without applying changes to subdirectories ). _SetOwnerAndPerms ( 'C:\Temp', @UserName, 1 ) Func _SetOwnerAndPerms ( $_FilePath, $_User=@UserName, $_Sub=0 ) ; Set owner and full control access permission for file or directory. Local $_SubinaclPath = @SystemDir & '\subinacl.exe', $_Select='' If Not $_Sub Then $_Sub =' /file' If $_User=@UserName Then $_User=@ComputerName & '\' & @UserName If StringInStr ( FileGetAttrib ( $_FilePath ), "D" ) And $_Sub Then $_Sub = ' /subdirectories' $_Select='\*.*' EndIf RunWait ( @ComSpec & ' /c ' & $_SubinaclPath & $_Sub & ' "' & $_FilePath & $_Select & '" grant=' & $_User & '=f /setowner=' & $_User, '', @SW_HIDE ) EndFunc ;==> _SetOwnerAndPerms ( ) Edited January 28, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
ripdad Posted January 28, 2011 Share Posted January 28, 2011 CHANGED TO ADMINISTRADORES INSTEAD OF ADMINISTRATORSSorry, I didn't take other languages into account. Maybe I should have used S-1-5-32-544 SID.ERROR: Writing SD to <\\?\J:\autorune.infd> failed with: Acceso denegado.What kind of file system is "J:"?? ... If it's FAT .. this won't work. Must be NTFS.ERROR in command line: Invalid SID entry s:luis in a parameter option -ownr specified: n:administrators;s:luis!administrators is not an SID. This is an SID: "n:S-1-5-32-544;s:y"s:n/ys = IsSID?n = Noy = YesTry replacing n:administrators with n:S-1-5-32-544;s:ySetACL took me a about week to somewhat grasp. It can be very confusing.Especially, if you're doing some very unorthodox things with it. <g> "The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward Link to comment Share on other sites More sharing options...
tsue Posted January 28, 2011 Author Share Posted January 28, 2011 I forget /file argument, last post corrected. Edit : and this one for files or Directory ( with or without applying changes to subdirectories ). _SetOwnerAndPerms ( 'C:\Temp', @UserName, 1 ) Func _SetOwnerAndPerms ( $_FilePath, $_User=@UserName, $_Sub=0 ) ; Set owner and full control access permission for file or directory. Local $_SubinaclPath = @SystemDir & '\subinacl.exe', $_Select='' If Not $_Sub Then $_Sub =' /file' If $_User=@UserName Then $_User=@ComputerName & '\' & @UserName If StringInStr ( FileGetAttrib ( $_FilePath ), "D" ) And $_Sub Then $_Sub = ' /subdirectories' $_Select='\*.*' EndIf RunWait ( @ComSpec & ' /k ' & $_SubinaclPath & $_Sub & ' "' & $_FilePath & $_Select & '" grant=' & $_User & '=f /setowner=' & $_User, '', @SW_HIDE ) EndFunc ;==> _SetOwnerAndPerms ( ) it works, but only when i write it directly to cmd, when i try to run it using @ComSpec & ' /c ' nothing happens, could it be because im using windows 7 Link to comment Share on other sites More sharing options...
wakillon Posted January 28, 2011 Share Posted January 28, 2011 (edited) it works, but only when i write it directly to cmd, when i try to run it using @ComSpec & ' /c ' nothing happens, could it be because im using windows 7 I have writed ' /k ' for have the time to see the cmd window, but it must be ' c/ ' for normal use... Previous post corrected. For debug, try like this : you will see the cmd window and error message of subinacl. _SetOwnerAndPerms ( 'C:\Temp', @UserName, 1 ) Func _SetOwnerAndPerms ( $_FilePath, $_User=@UserName, $_Sub=0 ) ; Set owner and full control access permission for file or directory. Local $_SubinaclPath = @SystemDir & '\subinacl.exe', $_Select='' If Not $_Sub Then $_Sub =' /file' If $_User=@UserName Then $_User=@ComputerName & '\' & @UserName If StringInStr ( FileGetAttrib ( $_FilePath ), "D" ) And $_Sub Then $_Sub = ' /subdirectories' $_Select='\*.*' EndIf RunWait ( @ComSpec & ' /k ' & $_SubinaclPath & $_Sub & ' "' & $_FilePath & $_Select & '" grant=' & $_User & '=f /setowner=' & $_User ) EndFunc ;==> _SetOwnerAndPerms ( ) Edited January 28, 2011 by wakillon AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
tsue Posted January 29, 2011 Author Share Posted January 29, 2011 thanks for all the help Link to comment Share on other sites More sharing options...
wakillon Posted January 29, 2011 Share Posted January 29, 2011 thanks for all the helpThanks, but have you find why nothing happens ? AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
tsue Posted January 30, 2011 Author Share Posted January 30, 2011 Thanks, but have you find why nothing happens ? yesi dont know why but it has to have more quotes for comspecFunc _SetOwnerAndPerms ( $_FilePath ) Local $_SubinaclPath = @SystemDir & '\subinacl.exe' RunWait ( @ComSpec & ' /c ""' & $_SubinaclPath & '" "' & $_FilePath & '"" /setowner=' & @ComputerName & '\' & @UserName, '', @SW_HIDE ) Local $_CaclsPath = @SystemDir & '\CACLS.exe' RunWait ( @ComSpec & ' /c "' & $_CaclsPath & ' "' & $_FilePath & '" /E /G "' & @ComputerName & '\' & @UserName & '":F', '', @SW_HIDE ) EndFunc ;==> _SetOwnerAndPerms ( ) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now