Cygwin Bash from dos: bash -lc "/cygdrive/d/BACKUP/offsite/offsite.sh" or bash -lc "D:/BACKUP/offsite/offsite.sh" --------------------------------------------- Multiple commands on one line (use &): move curr temp & move old curr & move temp old --------------------------------------------- RUNAS: runas /user:computername\Administrator "rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl" --------------------------------------------- set time on current pc from the server net time \\server /set /yes --------------------------------------------- Run the arguement %1 using "command". /y steps through the batch file. /c specifies the file to run. @command /y /c %1 --------------------------------------------- This line will run regedit on the command line with no program output with a registry input file named nocache.reg - here is the reg file: REGEDIT /s \\MY_PDC\netlogon\nocache.reg copy notepad shortcut to sendto menu: copy \\MY_PDC\netlogon\notepad.exe.lnk c:\windows\sendto --------------------------------------------- Search for doskey in autoexec.bat and put a line in there if not found: type c:\autoexec.bat | find "doskey" /i | if not errorlevel 1 goto doskeyend echo >> c:\autoexec.bat c:\windows\command\doskey.com :doskeyend --------------------------------------------- Copy hosts file to systemroot: copy \\fletch\netlogon\hosts %systemroot%\system32\drivers\etc\hosts --------------------------------------------- Get all users in a domain: net user /domain ---------------------- To get all of the users on a machine: ???? ---------------------- To change a user's password at the command prompt, log on as an administrator and type: "net user * /domain" (without the quotation marks) Alternatively, you can type the following command: net user . When you do so, the password changes without prompting you again. This command also enables you to change passwords in a batch file. --------------- Script to see who's logged in: net view /domain:ipsb nbtstat -a _pc_name_ grep <03> ---------------------- Script to add a user and set their home directory: NET USER /ADD username password /COMMENT:"Example Account for User" /EXPIRES:never /HOMEDIR:\\server\Profile$ \%username%$ /PROFILEPATH:\\server\Profile$\username /PASSWORDCHG:no /DOMAIN ---------------------- To cause the batch file to display the current directory every time it changes, add the following commands after each current directory change: for /f "Tokens=*" %%i in ('CD') do set CurDir=%%i title %CurDir% ---------------------- TS profile command: tsprof /update {/domain:DomainName | /local} /profile:ProfilePath UserName tsprof /copy {/domain:DomainName | /local} [/profile:ProfilePath] SourceUser DestinationUser tsprof /q {/domain:DomainName | /local} UserName ---------------------- To create groups add a user to them: net localgroup "Accounting Local Resource Group" /add /COMMENT:"Payroll and A/R Files" net group "Accounting Members" /ADD /COMMENT:"Members have access to Payroll and A/R Files" net localgroup "Accounting Local Resource Group" "Accounting Members" /ADD net group "Accounting Members" jsmith /ADD ----------------------