Click here to Skip to main content
15,746,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello, I'm new in this forum.

I have a simple windows application where I want to run a batch file.
I use this code:

Process.Start("myFile.bat")


But the code only executes the first line of the batch file.

Do you have any ideas why?

PS: I'm Italian, sorry for my terrible English :doh:
Posted
Updated 12-Oct-10 22:42pm
v3
Comments
Dalek Dave 13-Oct-10 4:43am    
Minor Edit for Grammar, and your English is fine, better than my Italian, Molto Bene.

The problem is in your bat file. If you showed it maybe we could help
 
Share this answer
 
this is my batch
VB
sqlcmd -S PC-SERVER\SQLEXPRESS -i "D:\BK_NONE\BACKUP.SQL"
If not exist %~f1.\tmp.BAK (Echo files not found in %~f1 & GoTo :EOF)
SET mese=%DATE:~3,2%
SET giorno=%DATE:~0,2%
SET anno=%DATE:~-4%
SET ora=%TIME:~0,2%
SET min=%TIME:~3,2%
SET sec=%TIME:~6,2%
Ren "%~f1.\tmp.BAK" "%anno%%mese%%giorno%%ora%%min%%sec%.bak"


if i run this bath from windows there aren't problem then i run from vb.net code runnig only first line

i don't think that my problem is in the batch file.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900