0

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

3
  • This runs your commands a line at a time (or batch files or any program) in a hidden command window. Set WshShell = WScript.CreateObject("WScript.Shell"): WshShell.Run "cmd /k dir c:\windows\*.*", 0, false) Commented Jul 10, 2014 at 10:14
  • Thanks for the comment. :) I would need it to be visible because the user needs to input data. Commented Jul 10, 2014 at 14:27
  • Can't help thosethat won't ne helped. Commented Jul 10, 2014 at 20:31

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.