SecuirtyZone Posted January 6, 2015 Share Posted January 6, 2015 (edited) hello everyone I want after run my script ( exe ) ===)) delet line in The same script who runing something like that in vbscript : for exemple for delet secuirty this is code : string = replace(Split(CreateObject("Scripting.FileSystemObject").OpenFile(wscript.scriptfullname).ReadAll, vbCrLf)(a),"secuirty","") this code replaced secuirty to Vacuum i want this code on autoit Edited January 6, 2015 by SecuirtyZone Link to comment Share on other sites More sharing options...
guinness Posted January 6, 2015 Share Posted January 6, 2015 The executable is compiled, therefore what you want to do can't be done. I therefore suspect you don't have the original source code. Oh, and please read the Forum Rules as you're new hear (link at the bottom of the page). 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...
SecuirtyZone Posted January 6, 2015 Author Share Posted January 6, 2015 ok my friend thank you , what about edit .au3 ? And delete some stuff when it runs ! Link to comment Share on other sites More sharing options...
guinness Posted January 6, 2015 Share Posted January 6, 2015 (edited) Call me stupid, but if you have the source code, why not just edit the code before executing? Edited January 6, 2015 by guinness 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...
SecuirtyZone Posted January 6, 2015 Author Share Posted January 6, 2015 I have source code but iwant for exemple when i run script.au3 ==)) delet some code in script.au3 when its runs thank you Link to comment Share on other sites More sharing options...
guinness Posted January 6, 2015 Share Posted January 6, 2015 Have you searched the help file? 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...
SecuirtyZone Posted January 6, 2015 Author Share Posted January 6, 2015 Yes but i dont find somthing like this I make it in vbscript when i run script.vbs file ==) automatically delet some codes in script.vbs but i need it in autoit thank you for Reply Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 6, 2015 Moderators Share Posted January 6, 2015 SecuirtyZone,Can you please explain why you want to delete lines from an uncompiled script on execution? As the script can be read as plain text before execution, what is the point? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
SecuirtyZone Posted January 6, 2015 Author Share Posted January 6, 2015 Melba23 i have smart idea for protect my script with use this code Link to comment Share on other sites More sharing options...
Solution Guest Posted January 6, 2015 Solution Share Posted January 6, 2015 (edited) I do not think that's you have to do it while the script compiled. There are other methods that can serve this purpose when the script is compiled.But when the script is not compiled, you can use this method: #include <File.au3> If Not @Compiled Then Local $tmp1, $nLines = _FileCountLines(@ScriptFullPath) For $a = 1 To Random(3,10,1) $tmp1 = Random(1, $nLines, 1) _FileWriteToLine(@ScriptFullPath, $tmp1, " ", 1) Next EndIf But I did not give you a complete example. It is almost useless if you do not know how to hide the 'If Not @Compiled Then' line and if you do not do some other stuff (distractions) EDIT: Better Example: #include <File.au3> If Not @Compiled Then Local $nLines = _FileCountLines(@ScriptFullPath) For $a = 1 To Random(3,10,1) _FileWriteToLine(@ScriptFullPath,Random(1,$nLines,1)," ",1) Next EndIf Edited January 6, 2015 by Guest Link to comment Share on other sites More sharing options...
jguinch Posted January 6, 2015 Share Posted January 6, 2015 When you launch a script, it is read in memory. Try this : FileDelete(@ScriptFullPath) MsgBox(0, "", "") You can see the msgbox on your screen even if the file does dot exist... Spoiler Network configuration UDF, _DirGetSizeByExtension, _UninstallList Firefox ConfigurationArray multi-dimensions, Printer Management UDF Link to comment Share on other sites More sharing options...
SecuirtyZone Posted January 6, 2015 Author Share Posted January 6, 2015 I do not think that's you have to do it while the script compiled. There are other methods that can serve this purpose when the script is compiled. But when the script is not compiled, you can use this method: #include <File.au3> If Not @Compiled Then Local $tmp1, $nLines = _FileCountLines(@ScriptFullPath) For $a = 1 To Random(3,10,1) $tmp1 = Random(1, $nLines, 1) _FileWriteToLine(@ScriptFullPath, $tmp1, " ", 1) Next EndIf But I did not give you a complete example. It is almost useless if you do not know how to hide the 'If Not @Compiled Then' line and if you do not do some other stuff (distractions) EDIT: Better Example: #include <File.au3> If Not @Compiled Then Local $nLines = _FileCountLines(@ScriptFullPath) For $a = 1 To Random(3,10,1) _FileWriteToLine(@ScriptFullPath,Random(1,$nLines,1)," ",1) Next EndIf Yeees thank you so much That what i want <3 can you make script delet just the first Character In the first line And in the second line Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted January 6, 2015 Moderators Share Posted January 6, 2015 Maybe you can share your idea on how to "protect" your script by making something un-runnable ever again? Wouldn't it just be easier to remove the script/exe from the hard drive ( a _selfdelete() method )? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
SecuirtyZone Posted January 6, 2015 Author Share Posted January 6, 2015 Maybe you can share your idea on how to "protect" your script by making something un-runnable ever again? Wouldn't it just be easier to remove the script/exe from the hard drive ( a _selfdelete() method )? its long idea When I implement this idea And worked successfully maybe i shared it Link to comment Share on other sites More sharing options...
Guest Posted January 6, 2015 Share Posted January 6, 2015 its long idea When I implement this idea And worked successfully maybe i shared it Well, You know you owe me Link to comment Share on other sites More sharing options...
SecuirtyZone Posted January 6, 2015 Author Share Posted January 6, 2015 Well, You know you owe me thank your my friend for code , can you make it delet just first character in first line and second line ? Link to comment Share on other sites More sharing options...
Guest Posted January 6, 2015 Share Posted January 6, 2015 LazyZone, it is too simple that i don't need to help you.. You should try to get this result alone. It is better to try things on your own even if it will take more time because this way you have a chance to go far Link to comment Share on other sites More sharing options...
SecuirtyZone Posted January 6, 2015 Author Share Posted January 6, 2015 (edited) LazyZone, it is too simple that i don't need to help you.. You should try to get this result alone. It is better to try things on your own even if it will take more time because this way you have a chance to go far ok can you explain me this line in your code i don't understand it For $a = 1 To Random(3,10,1) and Random(1,$nLines,1)," ",1) thank you Edited January 6, 2015 by SecuirtyZone Link to comment Share on other sites More sharing options...
Guest Posted January 6, 2015 Share Posted January 6, 2015 (edited) ok can you explain me this line in your code i don't understand it For $a = 1 To Random(3,10,1) and Random(1,$nLines,1)," ",1) thank you The purpose of the code is to delete random lines and this happens in Random times.. ( You probably did not understand the second part of the sentence. Sorry) This: For $a = 1 To Random(3,10,1) 3/4/5/6/7/8/9/10 $a 1 Random(3,10,1) For $var = [start number] to [end number] What will happen Next Means that What will happen(delete lines) will occur several times. the several times can be between 3 times to 10 times thanks to Random(3,10,1) you can set that it will heppen more times by change the values to higher values. About What will happen: Random(1,$nLines,1) Means that the line number that will be deleted will be between 1 to the max line number in the script Edited January 6, 2015 by Guest Link to comment Share on other sites More sharing options...
kylomas Posted January 6, 2015 Share Posted January 6, 2015 Once the TO value in a For...To... loop is set it cannot be changed per the Help file... If stepVal or stop is a variable, its value is only read the first time the loop executes. Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill 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