|
Answer» I'm trying to make a batch file that copies my firefox bookmarks to my desktop. I'd like to be able to use this with any computer, so I'm trying to find a way to either autodetect which user is logged in, or have an input area in the batch file for me to type a username.
So far this is my code:
Code: [SELECT]ECHO OFF Title Copying Firefox Bookmarks ECHO Are you sure you WISH to copy Firefox's bookmarks? ECHO Y/N? SET /p play= IF %play% EQU y GOTO start IF %play% EQU n EXIT :start ECHO This program is currently set to copy bookmarks for user: (username) to the desktop. ECHO To change this, edit this code and change "(username)" to the correct username. PAUSE CLS ECHO Copying Bookmarks. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks.. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks... PING localhost n -.5 >nul CLS ECHO Copying Bookmarks. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks.. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks... PING localhost n -.5 >nul CLS ECHO Copying Bookmarks. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks.. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks... PING localhost n -.5 >nul CLS XCOPY "C:\Documents and Settings\(username)\Application Data\Mozilla\Firefox\Profiles\e0nu0mbl.default\bookmarks.html" "C:\Documents and Settings\(username)\Desktop" PING localhost n -10 >nul CLS ECHO Bookmarks have been copied. PING localhost n -10 >nul PAUSE Note that where it says (username) it actually has my username. I'm trying to find a way to make SOMETHING like "Please Input Username: _" that will automatically alter the copy/save locations.
Anyone got something that will help?
By the way, I might want an approval thing that says something like
"Files will be copied to C:\Documents and Settings\(username)\Desktop, is this okay? Y/N"
That last bit isn't necessary, but I would like it. You can use the variable name %username% which will resolve to the current user.
Quote I'd like to be able to use this with any computer
The e0nu0mbl.default directory is unique to your machine. Other machines will have different values. You may have to extract the subfolder names from C:\Documents and Settings\Username\Application Data\Mozilla\Firefox\Profiles to compute the actual profile directory name.
Cool, thanks What is the need for this?
Code: [Select]ECHO Copying Bookmarks. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks.. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks... PING localhost n -.5 >nul CLS ECHO Copying Bookmarks. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks.. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks... PING localhost n -.5 >nul CLS ECHO Copying Bookmarks. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks.. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks... PING localhost n -.5 >nul
Quote from: JACOB on November 15, 2008, 10:28:19 AMWhat is the need for this?
Code: [Select]ECHO Copying Bookmarks. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks.. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks... PING localhost n -.5 >nul CLS ECHO Copying Bookmarks. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks.. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks... PING localhost n -.5 >nul CLS ECHO Copying Bookmarks. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks.. PING localhost n -.5 >nul CLS ECHO Copying Bookmarks... PING localhost n -.5 >nul
Makes a cool light show for when you're stoned?
Quote from: Dias de verano on November 15, 2008, 11:47:19 AMMakes a cool light show for when you're stoned?
LOL, sounds great.
|