Virtual Audio Cable .bat file output/input device language error - batch-file

I've been trying to set up a .bat file for launching my Virtual Audio Cable setup for easy use. It turned out to be more troublesome than first expected.
The special characters "ÆØÅ" that is found on my device names are messing up with the VAC application.
My .bat file looks as such:
chcp 1252
start /min "audiorepeater" "D:\Programmer\Virtual Audio Cable\audiorepeater.exe" /Input: "Mikrofon på headset (8-Logitec" /Output: "Line 1 (Virtual Audio Cable)" /BufferMs: 50 /Buffers: 8 /Autostart
start /min "audiorepeater" "D:\Programmer\Virtual Audio Cable\audiorepeater.exe" /Input: "Stereomix (2- Realtek High Defi" /Output: "Line 1 (Virtual Audio Cable)" /BufferMs: 50 /Buffers: 8 /Autostart
start /min "audiorepeater" "D:\Programmer\Virtual Audio Cable\audiorepeater.exe" /Input: "Stereomix (2- Realtek High Defi" /Output: "Øresnegl på headset (8-Logitec" /BufferMs: 50 /Buffers: 8 /Autostart
The Stereomix -> Line 1 works fine. The others bug out, even though I finally after hours of research managed to get it to treat "ÆØÅ" correctly (Is shown in the error message).
The error message now reads: "No output device "Øresnegl på headset (8-Logitec"" even though that's the exact name of the output device in the list.
It's saved as "All files" and ANSI. Also tried messing with it in notepad++. No luck.
Im at a loss on how to make VAC recognize the name correctly, it seems to be a codepage incompatibility.
Thanks,
lindenkron

Go to your recording devices and change the name. Make it something else. It doesn't end with (8-Logitec) its much longer u you just can't see it.
Simply rename the device and then edit your .bat and save it out as .bat

Related

Controlling codepages in a cmd window when running batch scripts

I have problems controlling character code pages in a Windows cmd window, or rather in DOS scripts (.bat files) I use for certain tasks on my Windows 7 office computer.
Here is the problem:
One of my scripts is used to open certain files in their respective programmes, e.g.
C:\Stuff\Büroeinrichtung\MyFile.xlsx
The crucial thing here is the u-umlaut (ü) in the directory name.
In my script I use
Start "" "C:\Stuff\Büroeinrichtung\MyFile.xlsx"
to start Excel and open the file.
This works as long as I tell my text editor (Notepad++) to encode the script using codepage 850 (Western European), as this is what the cmd windows on my machine use by default.
However, I want to be able to use scripts that are encoded in something else, primarily UTF-8 or UTF-8-BOM. From answers to another question posted here I learned that principally I can set a command in the script for the cmd window to change the codepage, e.g. chcp 65001 for UTF-8. So my script would then look like
chcp 65001
pause :: this is here just to have some visual control while testing
Start "" "C:\Stuff\Büroeinrichtung\MyFile.xlsx"
pause :: dito
But: whatever I do, I do not get this running. The cmd window nicely accepts the change to the codepage, then stops due to pause (in Line 2), but on hitting "enter" to continue I
either get an alert that something is wrong with the ü (other, fancy, characters displayed), or
I get an alert that a directory of that name wasn't found (again obviously something wrong with the ü the actual bits of which seem to respresent something else) or
the cmd window just disappears (apparently crashed, and apparently never reaching Line 4 where a new pause would halt it).
I tried all possible combinations of codepages called in the script and various encodings for the script file (.bat) itself but did not get anywhere.
So, to put the long story short: What do I have to do, in a script encoded in UTF-8 (or so) and going to be run on a machine using codepage 850 by default that a character ü (u-umlaut) in a directory name is to be understood in the script as exactly ü, nothing else?

Windows CE 5 batch IF EXISTS

I'm trying to run a batch file on a WINCE device that will ping another networked device and capture the results in a text file.
However, whenever I try to execute the section that checks to see if the log file already exists, I get this error:
IF: incorrect command syntax
Can anyone shed some light as to why?
Here is the bit that creates the text file to log the results. It may or may not be worth mentioning, but it works fine on a windows 7 PC:
SET DATETIME=%date:~0,2%\%date:~3,2%\%date:~6,4% 0%time:~1,1%:%time:~3,2%:%time:~6,2%
if NOT exist %DATEVARIABLE%-log.txt type "New Log" > %DATEVARIABLE%-log.txt
Thanks
Doug
Something looks like this :
#echo off
SET "DATETIME=%date:~0,2%-%date:~3,2%-%date:~6,4%_%time:~1,1%-%time:~3,2%-%time:~6,2%"
echo "%DATETIME%"
pause
if NOT exist "%DATETIME%-log.txt" echo "New Log" > "%DATETIME%-log.txt"
pause

Batch chinese(?) symbols change in cmd

Related to this problem: Error code 259 when trying to pair using Bluetooth Command Line Tools
I made a simple batch that pairs my bluetooth gamepad with my PC, but unfortunately the gamepads screen name is in chinese(?) and when I run the batch the symbols are different in the cmd than in the batch.
I'm using Bluetooth Command Line Tools
Here's the batch:
rem #echo off
btpair -p -n"小米蓝牙手柄"
if errorlevel 1 goto error
exit
:error
pause
exit
...and here's what it looks like in the cmd window:
C:\Windows\system32>rem #echo off
C:\Windows\system32>btpair -p -n"Õ░Åþ▒│ÞôØþëÖµë﵃ä"
Remote device "ıª┼■ªªÌ¶Ï■ÙÍÁÙ´Áâõ" not found.
C:\Windows\system32>if errorlevel 1 goto error
C:\Windows\system32>pause
Press any key to continue . . .
I tested it manually (copy-pasted the name to cmd) and it worked, but not from batch.
As you can see I have a problem here...
Ideas?
You may be able to use the command line tool devcon.exe from Microsoft to disable and re-enable just that piece of hardware - it should re-pair the device as a side effect I am guessing.
Changing the codepage with the chcp command in the batch file may help with the chinese characters.
You must change your system locale to have chinese character input/output.
Control Panel -> Region -> Administrative -> Change system locale... -> Current system locale (change it here)

Is it possible to have a batch file input text into an application?

i.e. having a batch file automatically enter text into dos box to open games?
I'm trying to get Elder Scrolls Daggerfall to run automatically. It has an inconvenient amount of lines to input before actually being able to play. The lines I'd like it to input into DOSBox are:
mount c c:\dosgames -freesize 1000
mount d c:\dosgames\dfcd -t cdrom -label Daggerfall
c:
cd\dagger
dagger
I've tried taking an easier route and setting up a desktop shortcut to launch the game like on the wiki but haven't had any luck with that.
From DosBox's Help
AUTOMATION: Do I always have to type these commands?
In the DOSBox configuration file is an [autoexec] section. The commands
present there are run when DOSBox starts, so you can use this section
for the mounting. Look at Section 13: The configuration (options) file

Increasing Windows Mobile 5 Emulator Storage

I'm using the Microsoft Sync Framework to synchronize a SQL Server database with a SQL Compact SDF file on the Windows Mobile 5 emulator. We have a 2 gig SD card in the actual device we're deploying on so we'd like to store our database file there. However, when I map a shared folder as the storage card in the Windows Mobile 5 emulator, the SQL Compact engine is not able to create or modify a database file on the mapped storage card because of a bug. So to get past this during development on the emulator, I was just going to store the database on the internal device storage, however, it's limited to 32 MB and I can't find a way to increase it. Does anyone know how to increase the storage space on the emulator. I'm talking storage space not RAM :).
Otherwise, does anyone know how to get past the bug of not being able to have a SQL Compact database file on the storage card in the emulator?
Thanks!
Under http://forum.xda-developers.com/showthread.php?t=549675 you will find a driver for the emulator that sets up a RAM Disk, that for the emulator is seen as an external storage card but doesn't suffer from the issues with mapping a folder. I've checked with SQL Compact sdf file stored in the RAMDisk and it works like a charm. I've used it as a 64MB drive but supposedly it can handle up to 256 MB.
actually you can do this.
First of all open Device Emulator and run the emulator of your choice. In my case i open Windows Mobile 5.0
Then, as it runs, from device emulator, right click the emulator you just run and select Save-As, save it somewhere and then open this file with a text editor.
In there, you will find an option that says memsize, set it the following:
<MemSize Reconfigurable="true">256</MemSize>
Unfortunatly the maximum is 256 as it says if you try to set it higher.
Now, from Device Emulator, select the emulator entry that you just saved previously(Not the original, but the custom located under My Device Emulators in Device Emulator) and will be run with the cfg file that you just modified.
Hope this helps.
If you have an actual device I would recommend testing on the device by connecting it via active sync. I do not know how to change the memory of the emulator but I know that HP has emulators that you can download for testing and I would bet that one of them would match what you are trying to target.
In the Microsoft Device Emulator V3 (note that this installs in and over-writes the previous "\Microsoft Device Emulator\1.0" folder), using Windows Mobile 5, the help you get when typing "deviceemulator" with no parameters is pasted below. The first thing it states is that message about memsize. I tried it with values > 256 MB and just throws up the help dialog box. I was messing with this when trying to get it to recognize my /sharedfolder as a storage card. Maybe this will be possible in newer device emulators. If I can get it to work I can test placing an SDF file on the card.
Device Emulator
Memory size must be a value between 64 and 256.
Command Line Option Help
binfile - Filename of the binfile to be loaded by the emulator.
#responsefile - Filename to XML response file.
/a - Keeps emulator window always on top.
/battery - Emulates running from a battery instead of AC
/batterycharge percentage - Emulated battery charge percentage
/c - Creates and displays a console window to show output from Serial Port 1.
/cpucore - ARMv4 or ARMv5. Default is ARMv4.
/cpuoptions - A combination of (T)humb,D(ebug),I(nternetworking),M (Long Multiply),E (DSP). Of these, T,D,I will always be set.
/defaultsave - Use the VMID as the saved state name and place the saved state file in the per user directory.
/flash filename - Enables flash-memory emulation and specifies flash-memory storage filename.
/h - Sets host-only routing for network packets.
/hostkey keyname - Specifies host key, where keyname can be 'None', 'Left-Alt', or 'Right-Alt'.
/language LangID - Specifies the UI language, where LangID is a decimal.
/memsize size - Sets emulated RAM size, where size is in megabytes.
/nosecurityprompt - Do not prompt when enabling potentially unsafe peripherals when restoring from saved state.
/n [macaddress] - Enables CS8900 network adapter where optional macaddress specifies which host adapter the card will bind to.
/p [macaddress] - Enables NE2000 PCMCIA network adapter, where optional macaddress specifies which host adapter the card will bind to.
/r address - Specifies ROM file base address(in hexadecimal).
/rotate angle - Rotates the display by degrees, where angle can be 0, 90, 180, or 270.
/s filename - Specifies the save-state filename.
/sharedfolder directoryname - Mounts directoryname as a storage card.
/skin filename - Loads the specified skin file.
/tooltips state - Enables or disables tooltips, where state is 'ON' or 'OFF'.
/u0 serialport /u1 serialport /u2 serialport - Maps guest serial ports 0-2 to Windows serial ports.
/vfp - Vector Floating Point coprocessor: true or false. Default is false.
/video xx - Specifies screen size and bit-depth.
/vmid {GUID} - Specifies the VMID GUID.
/vmname name - Specifies the window title.
/z - Zooms the display to 2x normal size.
/speakerphone - {[SpeakerPhone][Headset][Carkit]} - Bitmapped number between 0-7 specifying Speakerphone, Headset, Carkit mode.
OK

Resources