Running Command Lines from C#

Below is a very helpful post, in the event you wish to fire a command line from a .cs file in C#.

http://stackoverflow.com/questions/1469764/run-command-prompt-commands

Advertisements

Archive SkyDrive with 7Zip

One of the down-sides of the new cloud sharing platforms is that you often don’t have a backup other than the recycle bin. (Dropbox does offer a PackRat feature.) I decided to do a little experiment with 7zip to see how I could create my own SkyDrive Archive.

  • First of all most of the cloud storage Giants have a file size upload limit, so we will need to break apart larger folders.
  • Download 7zip Command Line Utility.
  • Create a Folder Named Batch under your C:Drive.
  • Place the 7Zip Download file in the C:Batch Folder.
  • Also in the C:Batch folder make a new .txt document and save it as 7zip.bat.
  • Paste the following text in the 7zip.bat document:

 

cd /D C:UsersUserOneDrive
for /d %%X in (*) do C:Batch7za9207za.exe u “F:Backups%%X.7z” “%%X” -y -mx9 -mmt -wf:temp

  • Replaced the italicized   C:SkyDrive  with the path to your SkyDrive Folder.
  • The %%X  is a folder name wildcard. (So whatever the name is in the source folder, call it that in the destination folder.)
  • Save and run the batch file!
  • More helpful commands and their explanations can be found at the links below:

http://www.dotnetperls.com/7-zip-examples

http://www.7-zip.org/faq.html

http://www.wikihow.com/Use-7Zip-to-Create-Multiple-Compressed-Folders-in-One-Go