紧急求助,VB调用批处理命令的问题 100分悬赏
来源:百度知道 编辑:UC知道 时间:2024/05/11 05:47:52
我说的缺少某某文件 是我运行了批处理之后 批处理显示缺少某某文件啊
这是图http://n.99081.com/weizhen915/1.jpg
一下是批处理 希望大大们解答啊
Cd ./
title 真真专版1433
cls
color A
:1
echo @echo off >1.wmi
FOR /F "eol=; tokens=1,2 delims= " %%i in (ALLIP.TXT) do @echo cls^&s syn %%i %%j 1433 /save >%%i.bat© %%i.bat+gothin.cn %%j.wmi&del %%i.bat
copy *.wmi scan.bat&del *.wmi
call scan.bat
goto :1
你没进入目录,所以找不到那个文件。
Shell "cmd.exe /C CD C:\Docume~1\ & GO.bat", vbNormalFocus
Option Explicit
'在窗体上添加一个command1控件,然后复制以下代码,运行后点击command1按钮,即可看到结果。
'声明
Private Declare Function GetShortPathName Lib "kernel32" Alias _
"GetShortPathNameA" (ByVal lpszLongPath As String, _
ByVal lpszShortPath As String, ByVal cchBuffer As _
Long) As Long
Function ShortPath(ByVal Path As String) As String
Dim tmp As String
Dim l As Long
tmp = String(256, 0)
l = GetShortPathName(Path, tmp, Len(tmp))
ShortPath = Replace(Left(tmp, l), Chr(0), "")
End Function
'调用:
Private Sub Command1_Click()
Debug.Print ShortPath("C:\Documents and Settings\Go.bat")
End Sub
应该写成Shell "C:\Docume~1\Go.bat"
那就在运行批处理之前改一下APP.path
App.Path = "C:\Documen