WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Unicode

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

DirChange and Unicode

 Keywords:  

Question:

I need to DirChange() into a folder that is in Arabic (or has Arabic characters in it). This causes WinBatch (32 2007D) to stop excecution with the error code 1031 ("DirChange: Dir not found/changed")! Is there another way of doing this, or a better way of handling Unicode in general?

Answer:

Most WinBatch function have UNICODE versions or handle UNICODE automagically. You have discovered one of the few that do not. There are several ways to workaround this problem. One might be to try the following, assuming the full Arabic directory path in the 'swUnicodePath' variable
   KernelDll = DirWindows(1):"kernel32.dll"
   dllcall(KernelDll,long:"SetCurrentDirectoryW",lpwstr:swUnicodePath)
Keep in mind that you can't type Unicode strings directly into scripts because script files must be ANSI and you may have problems with this approach if your path changes the disk designator ('c:' for example) as well as the rest of the path.
Article ID:   W17483
File Created: 2008:04:10:15:11:28
Last Updated: 2008:04:10:15:11:28