Alternative for “msg” command in .bat file for Windows 10 (64 bit)












0















I wrote a small timer-script as a .bat-file, which reminds me (16 times) every 30 minutes (1800 sec) in a pop-up messagebox to "Move!". The script works fine on Windows 7 (32 bit) Systems, but it seems that the "msg" command can´t be used or is not existent for 64-bit Systems. Is there any alternative to this command or way to replace that command easily?



set TIMER=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)
set USERS=(%username%)
set MESSAGE=Move!

for %%i in %TIMER% do call :doit

:doit

for %%i in %USERS% do msg %%i %MESSAGE%

timeout /t 1800 /nobreak
goto:eof









share|improve this question























  • The command exists also on the 64-bit version of both Windows 7 and Windows 10. Do you have a Home edition or something, which might lack the msg command?

    – aschipfl
    Nov 28 '18 at 12:04








  • 1





    You may simplify your code this way: for /L %%i in (1,1,16) do ( (for %%m in (%USERS%) do msg %%m %MESSAGE%) & timeout /t 1800 /nobreak) You may split the code in several lines, if you wish...

    – Aacini
    Nov 28 '18 at 13:50











  • (On Windows 10) I had a similar issue trying to run msg from a .bat file through visual studio (runs fine when clicking on it but not through VS), the issue was the msg.exe is contained within the C:WindowsSystem32 folder and even supplying the full address of the .exe does not help as windows re-routes to the system folder when running it from 64 bit application. solution copy the msg.exe to the system folder

    – stuicidle
    Feb 6 at 11:59
















0















I wrote a small timer-script as a .bat-file, which reminds me (16 times) every 30 minutes (1800 sec) in a pop-up messagebox to "Move!". The script works fine on Windows 7 (32 bit) Systems, but it seems that the "msg" command can´t be used or is not existent for 64-bit Systems. Is there any alternative to this command or way to replace that command easily?



set TIMER=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)
set USERS=(%username%)
set MESSAGE=Move!

for %%i in %TIMER% do call :doit

:doit

for %%i in %USERS% do msg %%i %MESSAGE%

timeout /t 1800 /nobreak
goto:eof









share|improve this question























  • The command exists also on the 64-bit version of both Windows 7 and Windows 10. Do you have a Home edition or something, which might lack the msg command?

    – aschipfl
    Nov 28 '18 at 12:04








  • 1





    You may simplify your code this way: for /L %%i in (1,1,16) do ( (for %%m in (%USERS%) do msg %%m %MESSAGE%) & timeout /t 1800 /nobreak) You may split the code in several lines, if you wish...

    – Aacini
    Nov 28 '18 at 13:50











  • (On Windows 10) I had a similar issue trying to run msg from a .bat file through visual studio (runs fine when clicking on it but not through VS), the issue was the msg.exe is contained within the C:WindowsSystem32 folder and even supplying the full address of the .exe does not help as windows re-routes to the system folder when running it from 64 bit application. solution copy the msg.exe to the system folder

    – stuicidle
    Feb 6 at 11:59














0












0








0








I wrote a small timer-script as a .bat-file, which reminds me (16 times) every 30 minutes (1800 sec) in a pop-up messagebox to "Move!". The script works fine on Windows 7 (32 bit) Systems, but it seems that the "msg" command can´t be used or is not existent for 64-bit Systems. Is there any alternative to this command or way to replace that command easily?



set TIMER=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)
set USERS=(%username%)
set MESSAGE=Move!

for %%i in %TIMER% do call :doit

:doit

for %%i in %USERS% do msg %%i %MESSAGE%

timeout /t 1800 /nobreak
goto:eof









share|improve this question














I wrote a small timer-script as a .bat-file, which reminds me (16 times) every 30 minutes (1800 sec) in a pop-up messagebox to "Move!". The script works fine on Windows 7 (32 bit) Systems, but it seems that the "msg" command can´t be used or is not existent for 64-bit Systems. Is there any alternative to this command or way to replace that command easily?



set TIMER=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)
set USERS=(%username%)
set MESSAGE=Move!

for %%i in %TIMER% do call :doit

:doit

for %%i in %USERS% do msg %%i %MESSAGE%

timeout /t 1800 /nobreak
goto:eof






batch-file windows-10 64bit






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 28 '18 at 7:40









Mattis SeehausMattis Seehaus

198




198













  • The command exists also on the 64-bit version of both Windows 7 and Windows 10. Do you have a Home edition or something, which might lack the msg command?

    – aschipfl
    Nov 28 '18 at 12:04








  • 1





    You may simplify your code this way: for /L %%i in (1,1,16) do ( (for %%m in (%USERS%) do msg %%m %MESSAGE%) & timeout /t 1800 /nobreak) You may split the code in several lines, if you wish...

    – Aacini
    Nov 28 '18 at 13:50











  • (On Windows 10) I had a similar issue trying to run msg from a .bat file through visual studio (runs fine when clicking on it but not through VS), the issue was the msg.exe is contained within the C:WindowsSystem32 folder and even supplying the full address of the .exe does not help as windows re-routes to the system folder when running it from 64 bit application. solution copy the msg.exe to the system folder

    – stuicidle
    Feb 6 at 11:59



















  • The command exists also on the 64-bit version of both Windows 7 and Windows 10. Do you have a Home edition or something, which might lack the msg command?

    – aschipfl
    Nov 28 '18 at 12:04








  • 1





    You may simplify your code this way: for /L %%i in (1,1,16) do ( (for %%m in (%USERS%) do msg %%m %MESSAGE%) & timeout /t 1800 /nobreak) You may split the code in several lines, if you wish...

    – Aacini
    Nov 28 '18 at 13:50











  • (On Windows 10) I had a similar issue trying to run msg from a .bat file through visual studio (runs fine when clicking on it but not through VS), the issue was the msg.exe is contained within the C:WindowsSystem32 folder and even supplying the full address of the .exe does not help as windows re-routes to the system folder when running it from 64 bit application. solution copy the msg.exe to the system folder

    – stuicidle
    Feb 6 at 11:59

















The command exists also on the 64-bit version of both Windows 7 and Windows 10. Do you have a Home edition or something, which might lack the msg command?

– aschipfl
Nov 28 '18 at 12:04







The command exists also on the 64-bit version of both Windows 7 and Windows 10. Do you have a Home edition or something, which might lack the msg command?

– aschipfl
Nov 28 '18 at 12:04






1




1





You may simplify your code this way: for /L %%i in (1,1,16) do ( (for %%m in (%USERS%) do msg %%m %MESSAGE%) & timeout /t 1800 /nobreak) You may split the code in several lines, if you wish...

– Aacini
Nov 28 '18 at 13:50





You may simplify your code this way: for /L %%i in (1,1,16) do ( (for %%m in (%USERS%) do msg %%m %MESSAGE%) & timeout /t 1800 /nobreak) You may split the code in several lines, if you wish...

– Aacini
Nov 28 '18 at 13:50













(On Windows 10) I had a similar issue trying to run msg from a .bat file through visual studio (runs fine when clicking on it but not through VS), the issue was the msg.exe is contained within the C:WindowsSystem32 folder and even supplying the full address of the .exe does not help as windows re-routes to the system folder when running it from 64 bit application. solution copy the msg.exe to the system folder

– stuicidle
Feb 6 at 11:59





(On Windows 10) I had a similar issue trying to run msg from a .bat file through visual studio (runs fine when clicking on it but not through VS), the issue was the msg.exe is contained within the C:WindowsSystem32 folder and even supplying the full address of the .exe does not help as windows re-routes to the system folder when running it from 64 bit application. solution copy the msg.exe to the system folder

– stuicidle
Feb 6 at 11:59












1 Answer
1






active

oldest

votes


















1














You could create a temporary VBS script, run it then delete it.



See Example MessageBox



At the bottom of your program include:



exit /b
:msg
set tempPath=%temp%msgbox.vbs
echo msgbox "%message%" > %tempPath% && %tempPath% && del %tempPath%
goto:eof


You can then use it through your script like so:



set message=Hello World
call:msg


So in your case:



set TIMER=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)
set USERS=(%username%)
set MESSAGE=Move!

for %%i in %TIMER% do call :doit

:doit

set message=%MESSAGE%
call:msg

timeout /t 1800 /nobreak
goto:eof


exit /b
:msg
set tempPath=%temp%msgbox.vbs
echo msgbox "%message%" > %tempPath% && %tempPath% && del %tempPath%
goto:eof





share|improve this answer


























  • now i tried this solution, but it doesn´t work like this. the console window opens and Closes instantly without showing the messagebox.

    – Mattis Seehaus
    Nov 30 '18 at 6:36













  • I was too aggressive with those '&&': always test your code. Should be fixed now.

    – Andrew
    Dec 1 '18 at 4:41











  • This is great man! It works now! ( PS: Do you even know how to change the message box size?)

    – Mattis Seehaus
    Dec 2 '18 at 14:42













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53514416%2falternative-for-msg-command-in-bat-file-for-windows-10-64-bit%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














You could create a temporary VBS script, run it then delete it.



See Example MessageBox



At the bottom of your program include:



exit /b
:msg
set tempPath=%temp%msgbox.vbs
echo msgbox "%message%" > %tempPath% && %tempPath% && del %tempPath%
goto:eof


You can then use it through your script like so:



set message=Hello World
call:msg


So in your case:



set TIMER=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)
set USERS=(%username%)
set MESSAGE=Move!

for %%i in %TIMER% do call :doit

:doit

set message=%MESSAGE%
call:msg

timeout /t 1800 /nobreak
goto:eof


exit /b
:msg
set tempPath=%temp%msgbox.vbs
echo msgbox "%message%" > %tempPath% && %tempPath% && del %tempPath%
goto:eof





share|improve this answer


























  • now i tried this solution, but it doesn´t work like this. the console window opens and Closes instantly without showing the messagebox.

    – Mattis Seehaus
    Nov 30 '18 at 6:36













  • I was too aggressive with those '&&': always test your code. Should be fixed now.

    – Andrew
    Dec 1 '18 at 4:41











  • This is great man! It works now! ( PS: Do you even know how to change the message box size?)

    – Mattis Seehaus
    Dec 2 '18 at 14:42


















1














You could create a temporary VBS script, run it then delete it.



See Example MessageBox



At the bottom of your program include:



exit /b
:msg
set tempPath=%temp%msgbox.vbs
echo msgbox "%message%" > %tempPath% && %tempPath% && del %tempPath%
goto:eof


You can then use it through your script like so:



set message=Hello World
call:msg


So in your case:



set TIMER=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)
set USERS=(%username%)
set MESSAGE=Move!

for %%i in %TIMER% do call :doit

:doit

set message=%MESSAGE%
call:msg

timeout /t 1800 /nobreak
goto:eof


exit /b
:msg
set tempPath=%temp%msgbox.vbs
echo msgbox "%message%" > %tempPath% && %tempPath% && del %tempPath%
goto:eof





share|improve this answer


























  • now i tried this solution, but it doesn´t work like this. the console window opens and Closes instantly without showing the messagebox.

    – Mattis Seehaus
    Nov 30 '18 at 6:36













  • I was too aggressive with those '&&': always test your code. Should be fixed now.

    – Andrew
    Dec 1 '18 at 4:41











  • This is great man! It works now! ( PS: Do you even know how to change the message box size?)

    – Mattis Seehaus
    Dec 2 '18 at 14:42
















1












1








1







You could create a temporary VBS script, run it then delete it.



See Example MessageBox



At the bottom of your program include:



exit /b
:msg
set tempPath=%temp%msgbox.vbs
echo msgbox "%message%" > %tempPath% && %tempPath% && del %tempPath%
goto:eof


You can then use it through your script like so:



set message=Hello World
call:msg


So in your case:



set TIMER=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)
set USERS=(%username%)
set MESSAGE=Move!

for %%i in %TIMER% do call :doit

:doit

set message=%MESSAGE%
call:msg

timeout /t 1800 /nobreak
goto:eof


exit /b
:msg
set tempPath=%temp%msgbox.vbs
echo msgbox "%message%" > %tempPath% && %tempPath% && del %tempPath%
goto:eof





share|improve this answer















You could create a temporary VBS script, run it then delete it.



See Example MessageBox



At the bottom of your program include:



exit /b
:msg
set tempPath=%temp%msgbox.vbs
echo msgbox "%message%" > %tempPath% && %tempPath% && del %tempPath%
goto:eof


You can then use it through your script like so:



set message=Hello World
call:msg


So in your case:



set TIMER=(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16)
set USERS=(%username%)
set MESSAGE=Move!

for %%i in %TIMER% do call :doit

:doit

set message=%MESSAGE%
call:msg

timeout /t 1800 /nobreak
goto:eof


exit /b
:msg
set tempPath=%temp%msgbox.vbs
echo msgbox "%message%" > %tempPath% && %tempPath% && del %tempPath%
goto:eof






share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 1 '18 at 4:40

























answered Nov 28 '18 at 9:42









AndrewAndrew

856




856













  • now i tried this solution, but it doesn´t work like this. the console window opens and Closes instantly without showing the messagebox.

    – Mattis Seehaus
    Nov 30 '18 at 6:36













  • I was too aggressive with those '&&': always test your code. Should be fixed now.

    – Andrew
    Dec 1 '18 at 4:41











  • This is great man! It works now! ( PS: Do you even know how to change the message box size?)

    – Mattis Seehaus
    Dec 2 '18 at 14:42





















  • now i tried this solution, but it doesn´t work like this. the console window opens and Closes instantly without showing the messagebox.

    – Mattis Seehaus
    Nov 30 '18 at 6:36













  • I was too aggressive with those '&&': always test your code. Should be fixed now.

    – Andrew
    Dec 1 '18 at 4:41











  • This is great man! It works now! ( PS: Do you even know how to change the message box size?)

    – Mattis Seehaus
    Dec 2 '18 at 14:42



















now i tried this solution, but it doesn´t work like this. the console window opens and Closes instantly without showing the messagebox.

– Mattis Seehaus
Nov 30 '18 at 6:36







now i tried this solution, but it doesn´t work like this. the console window opens and Closes instantly without showing the messagebox.

– Mattis Seehaus
Nov 30 '18 at 6:36















I was too aggressive with those '&&': always test your code. Should be fixed now.

– Andrew
Dec 1 '18 at 4:41





I was too aggressive with those '&&': always test your code. Should be fixed now.

– Andrew
Dec 1 '18 at 4:41













This is great man! It works now! ( PS: Do you even know how to change the message box size?)

– Mattis Seehaus
Dec 2 '18 at 14:42







This is great man! It works now! ( PS: Do you even know how to change the message box size?)

– Mattis Seehaus
Dec 2 '18 at 14:42






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53514416%2falternative-for-msg-command-in-bat-file-for-windows-10-64-bit%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)