Reputation: 1
A troubled IT Technician looking for help here! I have 2 batch files that I need to put a GUI to instead of the end user just looking at the cmd line, therefore I need to convert the code to VB. Here's the two pieces of code that I have to tried to convert without success:
@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
Second File:
@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!
Any help will be much appreciated!
Many thanks, Joe
Upvotes: 0
Views: 252
Reputation: 9545
An idea :
@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
Upvotes: 1