mlhaufe

Conditional Copy JS

Oct 15th, 2011
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Reference <http://www.visualbasicscript.com/tm.aspx?high=&m=94260&mpage=1#94272>
  2. var net    = new ActiveXObject("WScript.Network"),
  3.     fso    = new ActiveXObject("Scripting.FileSystemObject"),
  4.     gDrive = (fso.FolderExists("g:\\") ? fso.GetFolder("g:\\") : null),
  5.     gGames = "g:\\savedgames",
  6.     cGames = "C:\\Users\\" + net.UserName + "\\Desktop\\savedgames"
  7.     savedGames = (gDrive ?
  8.                      fso.FolderExists(gGames) ?
  9.                          fso.GetFolder(gGames) :
  10.                          fso.CreateFolder(gGames)
  11.                  :   fso.FolderExists(cGames) ?
  12.                          fso.GetFolder(cGames) :
  13.                          fso.CreateFolder(cGames)),
  14.     agbPath = "C:\\Users\\Niels\\AppData\\Roaming\\Rovio\\Angry Birds",
  15.     agbFolder = fso.FolderExists(agbPath) ? fso.GetFolder(agbPath) : null,
  16.     rovioPath = "C:\\Users\\Niels\\AppData\\Roaming\\Rovio",
  17.     flashPath = "C:\\Users\\" + net.UserName + "\\AppData\\Roaming\\"
  18.               + "Macromedia\\Flash Player\\#SharedObjects\\87V4ZJLP\\"
  19.               + "dl.dropbox.com\\u\\12616360",
  20.     flashFolder = fso.FolderExists(flashPath) ?
  21.                   fso.GetFolder(flashPath) : null;
  22.  
  23. if(flashFolder)
  24.     fso.CopyFolder(flashPath, (gDrive ? gGames : cGames) )
  25. if(agbFolder)
  26.     fso.CopyFolder(rovioPath, (gDrive ? gGames : cGames) )
Advertisement
Add Comment
Please, Sign In to add comment