Monday, 13 October 2014

More visual basic scripting

Hello everybody and today this post is going to be another tutorial!

you know what to do so just paste the code:

echo hello user!
oh wait sorry we are going to be doing some batch!

@echo off
:main
echo hello user!
echo What is your name?
set /p userName=
goto a


a:
echo hello %userName%
set var=89
echo the secret variable is %var%

if EXIST text.txt (
echo The File Exists
start text.txt
)

if NOT EXIST text.txt (
echo error
)
pause


what the NOT EXIST and EXIST does is it checks the computer for text.txt
and if it is found it will say The File exists if the text.txt is in the same place of the program.
(basically if text.txt is on the desktop, and the program is on the desktop it will say it exists
and will start text.txt)

otherwise it will say error.

No comments:

Post a Comment