BAT文件和VB.Net [英] BAT file and VB.Net

查看:171
本文介绍了BAT文件和VB.Net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我是这个论坛的新成员.

我有一个简单的Windows应用程序,要在其中运行批处理文件.
我使用此代码:

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")



但是代码仅执行批处理文件的第一行.

你有什么想法吗?

PS:我是意大利语,很抱歉我的英语不好:doh:



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:

推荐答案

问题出在您的bat文件中.如果您显示了,也许我们可以帮忙
The problem is in your bat file. If you showed it maybe we could help


这是我的批处理
this is my batch
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"



如果我从Windows运行此程序,那没有问题,那么我从vb.net代码运行runnig仅第一行

我不认为我的问题出在批处理文件中.



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.


这篇关于BAT文件和VB.Net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆