Home > Batch, Computers, Programming, Windows > Simple little batch files.

Simple little batch files.

Either edit your PATH variable to include a new directory or place these *.bat files in %programfiles%/system32


Have the ls command in windows.
Filename: ls.bat

@rem START comment
@rem Have ls for windows.
@rem Created: 15 Nov 2008
@rem Author: Kyle rizzo
@rem Email: lifeforce0@gmail.com
@rem END comment

@echo off
dir %1 %2 %3 %4 %5 %6 %7 %8 %9

See system uptime (how long its been on).
Filename: uptime.bat

@rem START comment
@rem Display the uptime "running time" of a windows system.
@rem Created: 15 Nov 2008
@rem Author: Kyle rizzo
@rem Email: lifeforce0@gmail.com
@rem END comment

@echo off
systeminfo | find "System Up Time"
pause

Map a network folder to a local drive.
Run synctoy (extra program from microsoft http://lmgtfy.com/?q=Microsoft+synctoy ).
Then remove the mapped network drive.
Filename: netsync.bat

@rem START comment
@rem Map to a network drive on a domain prompt for a password
@rem Run synctoy to sync up a specific job CIT210-Java
@rem Disconnect the network mapped drive
@rem Created: 12 Jan 2011
@rem Author: Kyle rizzo
@rem Email: lifeforce0@gmail.com
@rem END comment

@echo off
echo ============================================
echo === Map the folder to z: for syncing ===
echo --------------------------------------------
echo.
net use z: \\exampleserver\directory\listing\kyle /PERSISTENT:no /USER:domain\username *

echo.
echo.
echo ===========================================
echo === Syncing the folder with z: ===
echo -------------------------------------------
echo.
"%PROGRAMFILES%\SyncToy 2.1\SyncToyCmd.exe" -R

echo.
echo.
echo =====================================
echo === Removeing the mapped drive z: ===
echo -------------------------------------
echo.
net use z: /delete
pause
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: