@echo off
echo 当前盘符:%~d0
echo 当前盘符和路径:%~dp0
echo 当前批处理全路径:%~f0
echo 当前盘符和路径的短文件名格式:%~sdp0
echo 当前CMD默认目录:%cd%
pause
db.bat:
set cur_directory=%~dp0
sqlcmd.exe -d Elecroc -i %cur_directory%\STOREDATABASE.SQL%
'sqlcmd.exe -d Elecroc -i STOREDATABASE.SQL
a.vbs:
dim path,pathdb
path = Session.Property("INSTALLDIR")
pathdb = path + "\XService\bin\db.bat"
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run pathdb,1
'WshShell.Run pathdb,0