Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: User Input?  (Read 2739 times)

0 Members and 1 Guest are viewing this topic.

revengexx14

    Topic Starter


    Starter

    User Input?
    « on: November 14, 2008, 08:46:35 PM »
    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.

    Sidewinder



      Guru

      Thanked: 139
    • Experience: Familiar
    • OS: Windows 10
    Re: User Input?
    « Reply #1 on: November 15, 2008, 05:35:04 AM »
    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.

     8)

    The true sign of intelligence is not knowledge but imagination.

    -- Albert Einstein

    revengexx14

      Topic Starter


      Starter

      Re: User Input?
      « Reply #2 on: November 15, 2008, 09:22:37 AM »
      Cool, thanks  ;D

      Jacob



        Hopeful

        Thanked: 1
        • Experience: Expert
        • OS: Windows XP
        Re: User Input?
        « Reply #3 on: November 15, 2008, 10:28:19 AM »
        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

        Dias de verano

        • Guest
        Re: User Input?
        « Reply #4 on: November 15, 2008, 11:47:19 AM »
        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

        Makes a cool light show for when you're stoned?


        Jacob



          Hopeful

          Thanked: 1
          • Experience: Expert
          • OS: Windows XP
          Re: User Input?
          « Reply #5 on: November 15, 2008, 01:24:44 PM »
          Makes a cool light show for when you're stoned?
          Lol, sounds great.