Micael André
Micael André

Reputation: 215

Script Shell CMD not running

I running Windows 10 and I can't execute a script shell in .bat

So, my code is:

@echo off
echo .  
echo MsgBox "TA MERE"
echo .
echo MsgBox "Salut ca va?"
> msgbox.vbs
cscript msgbox.vbs
loop

So, my script is running but the script do not create msgbox.vbs file on the desktop and the program close the Windows

Upvotes: 0

Views: 70

Answers (2)

Hackoo
Hackoo

Reputation: 18827

You can try something like that :

@echo off
REM We create our vbs file in temporary folder
REM If you want to create your vbs file on your desktop
REM Just Replace this line set "VBSFile=%Tmp%\%~n0.vbs" to
REM set "VBSFile=%userprofile%\desktop\%~n0.vbs"
set "VBSFile=%Tmp%\%~n0.vbs"
(     
    echo MsgBox "TA MERE TOI MEME LOL !",vbExclamation,"TA MERE TOI MEME LOL !"
    echo MsgBox "Salut Comment ca va ?",VbQuestion,"TA MERE TOI MEME LOL !"
)> "%VBSFile%"
REM We execute our vbs file
cscript /nologo "%VBSFile%"
REM We Clean our vbs file
Del "%VBSFile%"

Upvotes: 1

Compo
Compo

Reputation: 38579

This is a guess based upon what I think your script is supposed to do:

@echo off
(   echo.  
    echo MsgBox "TA MERE"
    echo.
    echo MsgBox "Salut ca va?"
)> msgbox.vbs
cscript msgbox.vbs

I've missed out loop because I don't know where you want to loop to.

Upvotes: 2

Related Questions