Code: Select all
set command=command [attrib] /s
call :check %command%
:check
if %3==...
But what if they don't use the additional "attrib"? Then /s would be %2
And how do I disallow the ability of turning echo back on, in order to prevent code leaks? It is a custom batch program, so they are allowed to run any command they want...
And this another program that I am trying to create, but am stuck on... a backup program that copies the content of the folder ".john924xps" into a folder named backup. And this is the code I have so far
Code: Select all
@echo off
title Backup
color 0a
if not exist "Backup" md "Backup"
cd .john924xps
for /f %%G in ('dir /b') do (xcopy "%%G" "%userprofile%\Desktop\Backup" /h /e /f /t /i)
pause
And I'm not exactly sure if in the code above I'm supposed to use /f or just a plain for loop.
FOR - Loop through a set of files in one folder
FOR /F - Loop through the output of a command
both seem like they can fit my expectations