Small BASIC
A programming language created by Microsoft that serves a stepping stone for beginners from block-based coding languages to more complex text-based languages.
280 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I am writing a bat file to create a folder on the desktop in the format MYOB_YYYYMMDD.
When I run the file all I get is a folder on the desktop with the name MYOB_022, I am not getting the full date.
Any help is greatly appreciated
@echo off
:: Setting YYYYMMDD
for /f "skip=1 tokens = 2-4 delims = (-)" %%a in ('echo/^|date') do (for /f "tokens = %t%-4 delims=.-/ " %%d in ('date/t') do (set %%a=%%d&set %%b=%%e&set %%c=%%f))
:: Create folder with date on Desktop
mkdir "C:\Users\michael.smith\Desktop\MYOB_%date:~10,4%%date:~7,2%%date:~4,2%"
:: move from docs to desktop
robocopy C:\Users\Public\Documents\MYOB "C:\Users\michael.smith\Desktop\MYOB_%date:~10,4%%date:~7,2%%date:~4,2%" /SEC /Z /E /log:C:\Users\michael.smith\Desktop\create_folder_copy_YYYYMMDD.txt /tee
The tag "small-basic" is for Technical questions about Microsoft Small Basic, the only text-based programming language and IDE built for students to learn to code
Please look for a more fitting tag as your question in not about Small Basic
e.g. "c++" or "dotnet-csharp" or even "not-supported""