Jump to content
Sign in to follow this  
CsM33

Another Filewrite Question

Recommended Posts

CsM33

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?

Share this post


Link to post
Share on other sites
Jos

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.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
CsM33

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?

Share this post


Link to post
Share on other sites
CsM33

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

Share this post


Link to post
Share on other sites
CsM33

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.

Share this post


Link to post
Share on other sites
Jos

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

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites
CsM33

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

Share this post


Link to post
Share on other sites
Confuzzled

FileInstall your pre-existing files?

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.