Jump to content

Passing variables to DOS


Recommended Posts

Ok, you need to use some data in the file with extended characters to see the problem. I've attached a file (Unicode.txt) with all the instructions and extended characters to test with. Hopefully someone will recognise the problem.

Thanks

Unicode.txt

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

I also just learned a neat trick with cmd.exe.

At the cmd prompt type "(" followed by {enter}

You can enter many commands (1 per line) after More? and then type ")" followed by {enter} on the last last line and it will run it like a batch file.

The next trick is to get the syntax correct with RunWait(@ComSpec ......

Example:

C:\>(

More? ECHO This is a really cool trick.

More? ECHO The time is %time%.

More? )

This is a really cool trick.

The time is 16:29:58.52.

C:\>

Edited by Fossil Rock

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

Link to comment
Share on other sites

Here's a slow workaround, but at least it does it correctly.

$UNICODE = 'C:\Unicode.txt'
$ANSI = 'C:\Ansi.txt'
$CONVERT = '"' & $UNICODE & '"' & " > " & '"' & $ANSI & '"'
Run("C:\WINDOWS\system32\cmd.exe")
WinWaitActive ("C:\WINDOWS\system32\cmd.exe")
Send ("chcp 1252 {enter}")
Send ('type ' & $CONVERT & '{enter}')
Send ("exit {enter}")

Agreement is not necessary - thinking for one's self is!

My-Colors.jpg

cuniform2.gif

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...