T Toley Active Member Licensed User Longtime User Feb 9, 2026 #1 I use this code from Erel File batch Windows (.bat) I can run a Windows batch file (.bat)? it's possible ? www.b4x.com 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.
I use this code from Erel File batch Windows (.bat) I can run a Windows batch file (.bat)? it's possible ? www.b4x.com 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.
Solution zed Feb 9, 2026 try this: Code: shl.Initialize("shl", "cmd.exe", Array As String("/c", File.Combine(File.DirTemp, "PicProg.bat")))
try this: Code: shl.Initialize("shl", "cmd.exe", Array As String("/c", File.Combine(File.DirTemp, "PicProg.bat")))
zed Well-Known Member Licensed User Feb 9, 2026 #2 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
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
T Toley Active Member Licensed User Longtime User Feb 9, 2026 #3 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
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")))
zed Well-Known Member Licensed User Feb 9, 2026 #4 try this: Code: shl.Initialize("shl", "cmd.exe", Array As String("/c", File.Combine(File.DirTemp, "PicProg.bat"))) Upvote 0 Solution
try this: Code: shl.Initialize("shl", "cmd.exe", Array As String("/c", File.Combine(File.DirTemp, "PicProg.bat")))
T Toley Active Member Licensed User Longtime User Feb 9, 2026 #5 Thank you very much @zed it works fine. I would not have found it by myself ! Upvote 0