Darknightx37 Posted April 1, 2015 Share Posted April 1, 2015 (edited) hay there i try to lock a .txt file so that nobody can read or edit it (I dont want to crypt the text inside). so that my script can store things in it but nobody can read or edit it is that possible? sry for my bad english gretz usbstick Edited April 1, 2015 by Darknightx37 Link to comment Share on other sites More sharing options...
TheDcoder Posted April 1, 2015 Share Posted April 1, 2015 (edited) You can prevent editing by using FileOpen Function Ex: $sFile = ; Path of file to lock FileOpen($sFile) TD P.S Note that it can't prevent reading Edited April 1, 2015 by TheDcoder EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
jguinch Posted April 1, 2015 Share Posted April 1, 2015 It would be simplier to hide the file by changing its attributes ? Or you can use an alternate data streams : '?do=embed' frameborder='0' data-embedContent>> Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
Darknightx37 Posted April 1, 2015 Author Share Posted April 1, 2015 You can prevent editing by using FileOpen Function Ex: $sFile = ; Path of file to lock FileOpen($sFile) TD P.S Note that it can't prevent reading thx for the answere but that is not what i was searching for i thought about a .txt that cant get opened so that nobody can read or a new datatype like "config.xyz" that only my script can read Link to comment Share on other sites More sharing options...
TheDcoder Posted April 1, 2015 Share Posted April 1, 2015 Sorry DarkNight, But its not possible without encryption P.S You can make your own format though, Still it will be readable EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted April 1, 2015 Share Posted April 1, 2015 Sounds like you want to use FileMove() and change the file extension. Somebody can still open it if they know to tell the computer to open the file with a program directly. NTFS Permissions may be a more secure way to actually lock it down. Link to comment Share on other sites More sharing options...
TheDcoder Posted April 1, 2015 Share Posted April 1, 2015 NTFS Permissions may be a more secure way to actually lock it down. Right, But attributes are easy to change with admin rights EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Darknightx37 Posted April 1, 2015 Author Share Posted April 1, 2015 Sounds like you want to use FileMove() and change the file extension. Somebody can still open it if they know to tell the computer to open the file with a program directly. NTFS Permissions may be a more secure way to actually lock it down. Thx for the answere "NTFS Permissions" what is that ? Link to comment Share on other sites More sharing options...
Darknightx37 Posted April 1, 2015 Author Share Posted April 1, 2015 FileWrite("config.xdat", "This is a test") i tryied this but i can still read it with notpad++ any ideas to avoid this ? Link to comment Share on other sites More sharing options...
TheDcoder Posted April 1, 2015 Share Posted April 1, 2015 i can still read it with notpad++ any ideas to avoid this ? Impossible EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
Darknightx37 Posted April 1, 2015 Author Share Posted April 1, 2015 Impossible ouh ok thats a pitty but thx for your fast replys Link to comment Share on other sites More sharing options...
ViciousXUSMC Posted April 1, 2015 Share Posted April 1, 2015 Right, But attributes are easy to change with admin rights Yeah, but that is the point usually if your an Admin is to have access to everything. Now if a corporation is setup where users have Admin rights, thats bad on them. If I had to go the way of encryption I would probably just keep my scripts on a thumbdrive with bitlocker. TheDcoder 1 Link to comment Share on other sites More sharing options...
guinness Posted April 1, 2015 Share Posted April 1, 2015 LockFile in my signature will "lock" the file to the process. FileOpen doesn't do that, which was incorrectly suggested above. 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...
TheDcoder Posted April 1, 2015 Share Posted April 1, 2015 Thanks guinness, I am still learning EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
MikahS Posted April 1, 2015 Share Posted April 1, 2015 You can check out my Short-Order Encrypter in my signature. It does file encryption and does not store the key internally. Snips & Scripts My Snips: graphCPUTemp ~ getENVvarsMy Scripts: Short-Order Encrypter - message and file encryption V1.6.1 ~ AuPad - Notepad written entirely in AutoIt V1.9.4 Feel free to use any of my code for your own use. Forum FAQ 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