B4J Question Jshell, running a batchfile from Dir.Assets

Toley

Active Member
Licensed User
Longtime User
I use this code from Erel My batch file run correctly when I write the exact path like in the exemple. But I want to run a batchfile loaded from the File.DirAssets
I have try with File.ReadString but the batch file is not running.

The error message is (in french): Error: La syntaxe du nom de fichier, de répertoire ou de volume est incorrecte.
 

zed

Well-Known Member
Licensed User
It's not possible to run a batch file on Dir.Assets.
You must first copy the file to another folder. For example: File.DirTemp
 
Upvote 0

Toley

Active Member
Licensed User
Longtime User
Than you @zed I've tried like this, but it says array expected
B4X:
File.Copy(File.DirAssets, "PicProg.bat", File.DirTemp, "PicProg.bat")
shl.Initialize("shl", "cmd.exe", Array("/c", File.DirTemp("PicProg.bat")))
 
Upvote 0

zed

Well-Known Member
Licensed User
try this:
Exemple:
shl.Initialize("shl", "cmd.exe", Array As String("/c", File.Combine(File.DirTemp, "PicProg.bat")))
 
Upvote 0
Top