Jump to content

svatvn

Active Members
  • Posts

    24
  • Joined

  • Last visited

svatvn's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. Hi all, I have a TXT-File with the content now I want to replace the content between xbeginx and xendx to make the TXT-File looks like my code doesnt work it seems it doesnt work on multiple lines.... $sFile = "source.txt" $sText = FileRead($sFile,FileGetSize($sFile)) $aFound = _StringBetween($sText,"[xbeginx]","[xendx]") $sText = StringReplace($sText, "$aFound", "clean") $sFileNew = "result.txt" FileWrite($sFileNew,$sText) can you help me? thanks
  2. its the code from DicatoroftheUSA #include <File.au3> $sDir=@scriptdir $aFiles = _FileListToArray('"'&$sDir&'"', "*.reg") For $I = 1 To $aFiles[0] Run(@comspec & " /k Regedit.exe /S " & '"' & $sdir & "" & $aFiles[$I] & '"') consolewrite(@lf&"Regedit.exe /S " &'"'& $sdir & "" & $aFiles[$I] & '"'&@lf) Next
  3. yeah sure, there is always this error message "line 7, "subscript used with non-Array variable"
  4. hey Dictator, thx again for checking, really thank you for helping me. but now it's line 7, "subscript used with non-Array variable" I still can't believe, that it is so complicated
  5. It's line 4, error in expression. I tried to look for wrong spaces or quotes already
  6. the code doesn't work. I assume you forgot #include <File.au3>, so I added it in, but it doesn't work too. can you check please? and of course you're right. more complicated is mor powerful.
  7. sorry, I don' get it may be I'm too stupid for that. What I get are just errors. can you make this code work? #include <File.au3> $aFiles = _FileListToArray('"& @ScriptDir & "/", "*.reg"'') For $I = 1 To $aFiles[0] Run("Regedit.exe /S "''& @ScriptDir & "/" & $aFiles[$I] & '"') Next In batch, it's just this line for %%i in ("%CD%*.reg") do (start /w regedit /s "%%i") why is it so unbelievable complicated in AutoIT?
  8. I've got another problem with spaces in the path of the scriptdir I tried to put quotes to "@ScriptDir", but it seems to be wrong. How can I make it work with spaces? sorry for my newbie-questions
  9. hi all, the backslash was the problem, it works now, #include <File.au3> $aFiles = _FileListToArray(@ScriptDir&"/", "*.reg") ; gets the list of *.reg files in the folder For $I = 1 To $aFiles[0] ; loops through the list of files, the number of them is contained in $aFiles[0] Run("Regedit.exe /S " & @ScriptDir&"/" & $aFiles[$I]) ; Run regedit with the /s command on each file in the array Next ; loop to the next one in the array. thank you very much for your patience
  10. I tried to replace "C:pathname" with @ScriptDir, but AutoIT's path definition is so complicated ... can you give me the correct code? sorry, I'm newbie in coding
  11. thx everybody, but the reg-files are in the scriptfolder, how would the code be for that?
  12. hi BrewMan, it doesnt work and I also tried to replace C:pathname with @ScriptDir, but it doesnt work either... can you check to code please?
  13. Hi guys, I have a code for batch like this: for %%i in ("%CD%\*.reg") do (start /w regedit /s "%%i") What I want is, that all .reg-files in a folder to be added to the registry, So what would be the code for Autoit? Thanks
  14. well, is it me or doesnt copy folders...? so, how can I tell DirCopy to copy the folders of an folder? does exactly what I want (copy the complete content of a folder to another folder. I don' know why it is so complicated in AutoIT...
  15. hi wow, thanks for the fast answer. @melba I don't know, how to copy the content of a folder (including files and subfolders) DirCopy only copy one single folder right? @rcmaehl: the code is what I need, unfortunately it only copies files, not folders.... so how can I tell the command, to copy folders too? (the complete content)
×
×
  • Create New...