Adding users and domain groups to local groups is easy with the GUI. However the GUI will not add local groups to existing groups. You must use the NET command for that.
Adding users and domain groups to local groups is easy with the GUI. However the GUI will not add local groups to existing groups. You must use the NET command for that.
Trying to modify a collection of files and directories can be time consuming. Here is a batch file that will do the work for you. Specify the path and/or files (this examples specifies all files and directories in the current location) and change the called function to do the specified work. Will even handle spaces in the file or directory names.
You can create a function to call frequently used code from within a batch file. First make a label and then call it using the Call function.
@ECHO OFF
SETLOCAL
CALL:getHello
ECHO World
GOTO:EOF
:getHello
ECHO Hello
:EOF
ENDLOCAL
The output will look like this.
Hello World
References:
DosTips.com
Batch files can use modifiers to get information about the file and its current path as well as passed in parameters.
This example uses a batch file named “test.bat” that exists in “C:\Test”.
To get the current drive letter:
@ECHO OFF
SETLOCAL
:: Get drive letter
ECHO %~d0
:: Get full filepath
ECHO %~f0
:: Get file name
ECHO %~n0
:: Get file extension
ECHO %~x0
ENDLOCAL
will return
C: C:\Test\test.bat test .bat
You can modify these parameters to examine arguments as well.
References:
Microsoft Technet