Hello everyone,
I tried to write a string below onto a text file but got error "Illegal delimiter found".
script = FileOpen("1.txt", "WRITE")
FileWrite(script,"$response.data | ForEach-Object {")
FileClose(script)
Does anyone have a work around for this?
Thanks in advance!
kle2
You are missing the first quote for 1.txt".
Jim
Quote from: JTaylor on February 05, 2025, 08:19:55 AMYou are missing the first quote for 1.txt".
Jim
Yeah..Thanks, Jim!
Quote from: kle2 on February 05, 2025, 07:57:07 AMHello everyone,
I tried to write a string below onto a text file but got error "Illegal delimiter found".
script = FileOpen("1.txt", "WRITE")
FileWrite(script,"$response.data | ForEach-Object {")
FileClose(script)
Does anyone have a work around for this?
Thanks in advance!
kle2
Despite what Jim wrote, seems a mix-up of WB and PS code.
Quote from: spl on February 05, 2025, 09:49:12 AMQuote from: kle2 on February 05, 2025, 07:57:07 AMHello everyone,
I tried to write a string below onto a text file but got error "Illegal delimiter found".
script = FileOpen("1.txt", "WRITE")
FileWrite(script,"$response.data | ForEach-Object {")
FileClose(script)
Does anyone have a work around for this?
Thanks in advance!
kle2
Despite what Jim wrote, seems a mix-up of WB and PS code.
Yes, correct! But whatever in the " ", Winbatch sees them as string.
Although it is of course impossible to tell what's really going on here, I think OP's intent is to use WB to write another script, written in some other language - presumably, based on your (spl's) comments, that other language is PS.
That said, I don't understand the comments about there being a missing quote. As far as I can tell, all the quotes are matched in the OP's OP. Am I missing something?
It would, of course, help if OP would tell us on which line WB flagged an error...
He changed the original post.
script = FileOpen("1.txt", "WRITE")
was
script = FileOpen(1.txt", "WRITE")
Quote from: JTaylor on February 06, 2025, 05:53:10 AMHe changed the original post.
script = FileOpen("1.txt", "WRITE")
was
script = FileOpen(1.txt", "WRITE")
That is correct. I am sorry for the confusion!