Close

Results 1 to 6 of 6
  1. #1
    DF VIP Member barne77's Avatar
    Join Date
    Sep 2002
    Location
    manchester
    Posts
    164
    Thanks
    0
    Thanked:        0
    Karma Level
    273

    Default problem howto???

    hi does anyone know how to do the following?

    i have a BAT Script which has the following in

    Rgprefresh /m:COMPUTERNAME /force

    i want it so that when i run it asks for the COMPUTERNAME and inserts it into the script

    any ideads

  2. #2
    DF VIP Member /dev/null's Avatar
    Join Date
    Feb 2004
    Location
    Behind You
    Posts
    2,952
    Thanks
    0
    Thanked:        0
    Karma Level
    451

    Default Re: problem howto???

    You can use "copy con" if you are willing to press ctrl+z before enter... If not, you can work around it a bit but see if this is ok first (demo below).

    Code:
    @echo off
    echo Enter some text, followed by ctrl+z, enter
    copy con userin
    echo you typed: 
    type userin
    pause

  3. #3
    DF VIP Member /dev/null's Avatar
    Join Date
    Feb 2004
    Location
    Behind You
    Posts
    2,952
    Thanks
    0
    Thanked:        0
    Karma Level
    451

    Default Re: problem howto???

    update: Just remembered, you may want to delete the temp file "userin" once your script is completed. Can of course be done automatically from within the batch file.

  4. #4
    DF VIP Member barne77's Avatar
    Join Date
    Sep 2002
    Location
    manchester
    Posts
    164
    Thanks
    0
    Thanked:        0
    Karma Level
    273

    Default Re: problem howto???

    not sure how u mean how do i add it to the file i need

  5. #5
    DF VIP Member /dev/null's Avatar
    Join Date
    Feb 2004
    Location
    Behind You
    Posts
    2,952
    Thanks
    0
    Thanked:        0
    Karma Level
    451

    Default Re: problem howto???

    Replace the line

    Code:
    Rgprefresh /m:COMPUTERNAME /force
    with

    Code:
    echo Enter the computer name (followed by ctrl+z then enter)
    copy con COMPUTERNAME
    Rgprefresh /m:COMPUTERNAME /force
    del ./COMPUTERNAME

  6. #6
    DF Rookie zappp64's Avatar
    Join Date
    Nov 2006
    Location
    London
    Posts
    23
    Thanks
    0
    Thanked:        0
    Karma Level
    218

    Default Re: problem howto???

    do you mean a batch file

    if so you have two options

    1 - use your enviroment variable

    so in the batch file the variable COMPUTERNAME needs to be %COMPUTERNAME% - therefore you can run this on any computer and the batch file will use the enviroment variable and parse it to the command

    thus you batch file would be

    Rgprefresh /m:%COMPUTERNAME% /force

    2 - use the variable in a batch file

    in your batch file subsititue the variable COMPUTERNAME to %1

    when you run the batch file you run it with the computer name

    thsui you batch file would be

    Rgprefresh /m:%1 /force

    so for example if the computer name is OFFICE you run as follows

    <batch file> %1

    and the name OFFICE is parse to the batch file under the variable %1
    Last edited by zappp64; 18th November 2006 at 07:35 PM.

Similar Threads

  1. Floppy problem
    By urbsy in forum PC Problems
    Replies: 8
    Last Post: 7th September 2002, 12:04 AM
  2. F12002 Problem
    By shawtek in forum Microsoft Consoles
    Replies: 9
    Last Post: 31st August 2002, 10:20 AM
  3. Problem with Compaq Armada E500 Laptop
    By Mr Olympia in forum PC Problems
    Replies: 2
    Last Post: 29th August 2002, 02:40 PM
  4. real audio recording problem
    By flypitcher in forum Music Factory
    Replies: 3
    Last Post: 28th August 2002, 11:25 PM

Social Networking Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •