Archive for September, 2009
We all want to tweak or windows systems to the extreme to get the quickest, most powerful system possible. Many people will disable multiple window services manually before game playing. What a pain!
Many times people forget what the services do or forget to restart the important ones. Services can be easily changed by creating batch [...]
September 7th, 2009 | Posted in Uncategorized | No Comments
To begin this process you need to create an action. If you don’t know how to do this or never used Photoshop’s actions before, I’ll explain it. First you must create a new action from the actions menu, give it a name and hit the record button. Photoshop will now memorize everything you do in [...]
September 7th, 2009 | Posted in Uncategorized | No Comments
Embed FTP script into a batch script. Add this line at the beginning of the FTP script:
@ftp -i -s:”%~f0″&GOTO:EOF
The “FTP -s:ftpscript.txt” option executes a FTP script wheres “%~f0″ resolved to the name of the running batch file. “GOTO:EOF” ends the batch script and makes sure the FTP script doesn`t run as part of the [...]
September 7th, 2009 | Posted in Batch File Examples | No Comments
The :sleep function puts the batch execution on hold for a certain amount of second.
:sleep -– waits some seconds before returning
:: — %~1 – in, number of seconds to wait
FOR /l %%a in (%~1,-1,1) do (ping -n 2 -w 1 127.0.0.1>NUL)
goto :eof
September 7th, 2009 | Posted in DOS Functions | No Comments
The getIP function filters the IP address from the ipconfig command output and returns it to the caller.
Code
:getIP — return THIS computers IP address
:: — %~1 - out, IP
SETLOCAL
set ip=
for /f “tokens=2,* delims=:. ” %%a in (’”ipconfig|find “IP Address””‘) do set ip=%%b
( ENDLOCAL & REM RETURN VALUES
IF “%~1″ NEQ “” (SET %~1=%ip%) ELSE (echo.%ip%)
)
goto :eof
Test [...]
September 7th, 2009 | Posted in DOS Functions | No Comments
Embedding SQL script within a batch script is just as easy. The following batch script executes itself in SQL context. The trick is the GOTO command in the first line of the script. When executing GOTO START in batch context than the command processor will jump to the label “:START” and [...]
September 7th, 2009 | Posted in Batch File Examples | No Comments
ASSOC Displays or modifies file extension associations.
AT Schedules commands and programs to run on a computer.
ATTRIB Displays or changes file attributes.
BREAK Sets or clears extended CTRL+C checking.
CACLS Displays or modifies access control lists (ACLs) of files.
CALL Calls one batch program from another.
CD Displays the name of or changes the current directory.
CHCP Displays or sets the [...]
September 7th, 2009 | Posted in Uncategorized | No Comments
This batch allows string substitution in a text file. It parses each line of a text file for a particular string and replaces it with another string.
I.e. To replace all occurrences of “Yellow Submarine” in “color.txt” with “uboot” and put the output on the screen run:
BatchSubstitute.bat “Yellow Submarine” uboot color.txt
Or
type color.txt|BatchSubstitute.bat “Yellow Submarine” uboot
Optionally pipe [...]
September 7th, 2009 | Posted in Batch File Examples | No Comments
Showing progress in the output window seems impractical in DOS batch, since there is no way to overwrite a previews output for an updated progress status during each progress tick. Using the ECHO command is not nice, screen content quickly scrolls out of sight. A practicable alternative may be to use the window TITLE for [...]
September 7th, 2009 | Posted in Batch File Examples | No Comments
This batch connects twice to the FTP server. First time it retrieves a list of files on the FTP server. This list is being trimmed to contain only files that don`t already exist locally. The files in the trimmed list are then downloaded during a second connection. Note: Since all files are passed into the [...]
September 7th, 2009 | Posted in Batch File Examples | No Comments