MSFN Forum: [solved] Batch file echo "|" - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

[solved] Batch file echo "|" Rate Topic: -----

#1 User is offline   jaws75 

  • Member
  • PipPip
  • Group: Members
  • Posts: 124
  • Joined: 22-April 06

Posted 18 November 2006 - 05:02 PM

I have a problem.
I'm making a batch file to create a .rc file for a list of files in a directory.
The only problem I have is I can't echo a "|" character.
The ascii is 124.

this is one of the lines I would like to echo
>>diag%x%.rc echo STYLE DS_FIXEDSYS | DS_MODALFRAME | DS_CENTER | WS_POPUP

How can it be done, or is there a vb alternative I could use?

Thanks in advance.

This post has been edited by jaws75: 18 November 2006 - 07:00 PM



#2 User is offline   LLXX 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Banned
  • Posts: 3,399
  • Joined: 04-December 05

Posted 18 November 2006 - 05:36 PM

Tried putting quotes around the whole string and then stripping the quotes off later with sed?

Or, this might be a job better done with a sed script.

#3 User is offline   jdoe 

  • Advanced Member
  • PipPipPip
  • Group: Banned
  • Posts: 314
  • Joined: 02-May 04

Posted 18 November 2006 - 06:14 PM

Like this it could work...

>>diag%x%.rc echo STYLE DS_FIXEDSYS ^| DS_MODALFRAME ^| DS_CENTER ^| WS_POPUP


ASCII 94 before |


:hello:

#4 User is offline   gunsmokingman 

  • MSFN Master
  • Group: Super Moderator
  • Posts: 2,020
  • Joined: 02-August 03
  • OS:none specified
  • Country: Country Flag

Posted 18 November 2006 - 06:17 PM

Try this for your line instead, if this is for a batch file then it will work.
jdoe, you beat me for the post because this was what I was going to post also.
So I will post the batch script that I tested on the line.

Quote

@echo Off 
set x=102
>>diag%x%.rc echo STYLE DS_FIXEDSYS ^| DS_MODALFRAME ^| DS_CENTER ^| WS_POPUP
echo STYLE DS_FIXEDSYS ^| DS_MODALFRAME ^| DS_CENTER ^| WS_POPUP
pause

This post has been edited by gunsmokingman: 18 November 2006 - 06:20 PM


#5 User is offline   jaws75 

  • Member
  • PipPip
  • Group: Members
  • Posts: 124
  • Joined: 22-April 06

Posted 18 November 2006 - 07:00 PM

Works perfect.

thanks guys!

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy