Jump to content

Another Filewrite Question


CsM33
 Share

Recommended Posts

I have a batch program that has tons of lines (like 30 something) and it will take forever if I write it like

FileWrite("C:\drive\test" & "\batch.bat","LINE1" & @CRLF & "LINE2" & @CRLF & "LINE3" & @CRLF & "LINE4")

Is there a faster way?

Link to comment
Share on other sites

  • Developers

I have a batch program that has tons of lines (like 30 something) and it will take forever if I write it like

FileWrite("C:\drive\test" & "\batch.bat","LINE1" & @CRLF & "LINE2" & @CRLF & "LINE3" & @CRLF & "LINE4")

Is there a faster way?

can you be more specific than "tons of lines" and "take forever" ?

Do you have one FileWrite() or multiple ?

It helps alot when you have multiple FileWrite() statements to do a FileOpen() and then FileWrite() to the returned FileHandle.. when done do a FileClose.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Well what I'm trying to do is to create an exe in autoit that makes a bunch of batch/other programs and sends them to a directory. Here is an example of one of the programs.

This is a .reg program I'm using on my schools computer to enable command prompt and registry editing.

FileWrite("C:\CsMBPG\REG" & "\EnableRegEditAndComPrompt.reg"," REGEDIT4" & @CRLF & "[HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesWinOldApp]" & @CRLF & ""Disabled"=dword:0" & @CRLF & _
"[HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem]" & @CRLF & ""DisableRegistryTools"=dword:0")

Now as you can imagine, copying and pasting each line of code is kinda difficult. Is there a way where I could just copy and paste the entire code without having to cut it and put it in qoutations and & @CRLF & after every line?

Link to comment
Share on other sites

To be more specific. Is there any way to kinda just write

Filewrite( "C:\CsMBPG\REG" & "\EnableRegEditAndComPrompt.reg". "

 REGEDIT4

[HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesWinOldApp]

"Disabled"=dword:0

[HKEY_CURRENT_USERSoftwareMicrosoftWindowsCurrentVersionPoliciesSystem]

"DisableRegistryTools"=dword:0" )

Edited by CsM33
Link to comment
Share on other sites

  • Developers

I know the above code would not work, but is there any easier way? I basically don't want to have to copy and paste every like of text into new quotations.

Why would you want to write a REG file with autoit3 ?

I assume you have the REG file already so you could just FileInstall() it ....

- or - am I mis understanding your objective ?

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Why would you want to write a REG file with autoit3 ?

I assume you have the REG file already so you could just FileInstall() it ....

- or - am I mis understanding your objective ?

I'm writing lots of files but I want the autoit program to be an installer of sorts. Kinda like a winzip/rar archive but instead of all the files being held there, I want the autoit program to create them. All I'm wondering is if there is an easier way so I don't have to copy and paste each line of code, then type & @CRLF & before copying/pasting another line of code.

Edited by CsM33
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...