Jump to content

propietary rights


tsue
 Share

Recommended Posts

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

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 user

the main reason i want to do this is fo the viruses wich protects themself by having a diferent admin/propietary user

please dont tell me to use an antivirus, thats the easy answer for most of the people that has responded me

antivirus only detects false positives and viruses in their database.

thanks

Link to comment
Share on other sites

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 parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

Link to comment
Share on other sites

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

hello, im stuck with the program, lets say i want to change the permisions of a file to mine, how do you do it

You 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

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
Edited 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

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 by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

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

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

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 by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

CHANGED TO ADMINISTRADORES INSTEAD OF ADMINISTRATORS

Sorry, 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 spec

ified: n:administrators;s:luis!

administrators is not an SID. This is an SID: "n:S-1-5-32-544;s:y"

s:n/y

s = IsSID?

n = No

y = Yes

Try replacing n:administrators with n:S-1-5-32-544;s:y

SetACL 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

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

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 by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

Thanks, but have you find why nothing happens ? Posted Image

yes

i dont know why but it has to have more quotes for comspec

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 ( )

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...