Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hallo,
how can I run a DOS command in a Macro?
for exampel:
copy *.txt test_new.txt /b /y
Set oShell = WScript.CreateObject("WSCript.shell")
oShell.run "copy *.txt test_new.txt /b /y"
Set oShell = WScript.CreateObject("WSCript.shell")
oShell.run "copy *.txt test_new.txt /b /y"
Sorry, it doesn’t work.
But if I create a BAT-file which contains the command (copy *txt test_new.txt /b/y) and starts the BAT-file with the macro it works:
Set oShell =
CreateObject("WScript.Shell")
oShell.Run "make_a_copy.bat"
Content of the BAT-File “make_a_copy.bat”:
start/MIN
copy *.txt test_new.txt /b /y
exit
So, thank You for Your help, even if it’s not the direct solution.