2014-07-10 114 views
0

困擾的IT技術人員在此尋找幫助!我有兩個批處理文件,我需要將GUI放到代替最終用戶只是查看cmd行,因此我需要將代碼轉換爲VB。下面是兩段代碼,我必須嘗試沒有成功轉換:將批處理文件轉換爲VB腳本

@ECHO OFF 
ECHO Contract Folder Creator v0.99 
ECHO ----------------------------- 
ECHO. 
ECHO Please enter the Client name: 
SET /P CLIENT= 
ECHO. 
ECHO Please enter the Job name: 
SET /P JOB= 
ECHO. 
\\server\Archive\psexec \\server "A:\NewContractBE.cmd" %CLIENT% %JOB% > NUL 

第二個文件:

@ECHO OFF 
ROBOCOPY "C:\Administration\New Sales Folder" "C:\Contracts\%1\%2" /E /COPY:DAT > NUL 
MKDIR "A:\Contracts\%1\%2\Not Backed Up" > NUL 
MKDIR "A:\Contracts\%1\%2\Not Backed Up\Other Documents" > NUL 
MKDIR "A:\Contracts\%1\%2\Not Backed Up\Pictures" > NUL 
MKLINK /J "C:\Contracts\%1\%2\Not Backed Up" "A:\Contracts\%1\%2\Not Backed Up" > NUL 
ECHO Done! 

任何幫助將非常感激!

非常感謝, 喬

+0

這將運行你的命令在時間線(或批處理文件或任何程序)在一個隱藏的命令窗口。 'Set WshShell = WScript.CreateObject(「WScript.Shell」): WshShell.Run「cmd/k dir c:\ windows \ *。*」,0,false)' – Noodles

+0

感謝您的評論。 :) 我會需要它是可見的,因爲用戶需要輸入數據。 – Storm08

+0

不能幫助這個不會幫助。 – Noodles

回答

1

一個想法:

@echo off 
call :Digita_box "Please enter the Client name:" "Contract Folder Creator v0.99" 
set "Client=Digita_" 
call :Digita_box "Please enter the JOB name:" "Contract Folder Creator v0.99" 
set "Job=Digita_" 
ECHO. 
\\server\Archive\psexec \\server "A:\NewContractBE.cmd" %CLIENT% %JOB% > NUL 
pause >nul 
exit /b 

:Digita_Box 
set Digita_= 
set Sub_Tit=%~2 
set Mensa=%~1 
echo wscript.echo inputbox(WScript.Arguments(0),WScript.Arguments(1)) >"%temp%\Digita_.vbs" 
for /f "tokens=* delims=" %%a in ('cscript //nologo "%temp%\Digita_.vbs" "%Mensa%" "%Sub_Tit%"') do set Digita_=%%a 
exit /b 
相關問題