Results 1 to 10 of 10
  1. #1
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Create s/cut to run CMD line (WinXP SP1)

    Could someone remind me how to make a desktop shortcut to run a DOS (or CMD) line? It's been too long and I can't remember for the life of me!

    I'm trying out Robocopy but after less than a day I'm already fed up with typing the entire line into a CMD window!

    Many thanks
    Beryl M


  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    La Verne, California, USA
    Posts
    313
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Create s/cut to run CMD line (WinXP SP1)

    Right-click anywhere on the unused portion of the desktop, select NEW>SHORTCUT, then follow the prompts to the System32 folder and target the Cmd.exe program.

  3. #3
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Create s/cut to run CMD line (WinXP SP1)

    Beryl

    Have you not come across BATch or ComManD (CMD files?).

    Just put the ROBOCOPY (or whatever) command line into NOTEPAD and then do Save As something like "ThePeril.BAT". Double-click on it in Explorer to run it, or make a shortcut.

    Put a line with PAUSE after the ROBOCOPY line to see the final stats.

    Here's a more practical BATch file...

    @echo off
    setlocal
    set log=%~n0.log
    if exist %log% del %log%
    set source=[your source path]
    set target=[your target path]
    set roboparms=/mirror /sec /w:2 /r:2
    robocopy %source% %target% %roboparms% > %log%
    notepad %log%
    endlocal

    You'll have had to have read the documentation to choose appropriate ROBOCOPY parameters. If you call the BATch file ROBOTEST.BAT you get all the log information in ROBOTEST.LOG.
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Create s/cut to run CMD line (WinXP SP1)

    Thanks, John, that was exactly what I couldn't remember - it's so long since I've done anything with DOS or batch files it had been filed a little too deep in my memory!

    <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>
    Beryl M


  5. #5
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Create s/cut to run CMD line (WinXP SP1)

    Quick query - all I have to change in that batch file you gave is the source and destination directories, yes?

    The %...% bits were a bit beyond what I got to in DOS so I'm not 100% certain of how they work.
    Beryl M


  6. #6
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Create s/cut to run CMD line (WinXP SP1)

    Beryl

    Yes, you'll need to change the source and target lines. The %log% etc entities are environment variables which are SET using (surprise!) the SET command, or, in some instances like %computername% % date% %time% are system variables and exist already. The only real reason for using them in that BATch file are because the ROBOCOPY line tends to get rather long, and being an old DOSser (!) I prefer to keep line length to about 80 characters. Check that you don't need any more, or different, ROBOCOPY command line switches.

    If you have any trouble, let me know (privately, if necessary!) - I always say I write BATch files for a living!

    PS if you write % d a t e % (without the spaces) it becomes
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  7. #7
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Create s/cut to run CMD line (WinXP SP1)

    John, I'm a little confused <img src=/S/confused.gif border=0 alt=confused width=15 height=20> (not unusual, I have to admit!). I set up the batch file exactly as you said (I even copied the content verbatim from your post) and put in the correct source and target drives, but all it does is run the basic robocopy Welcome screen - ie it behaves as if all I've put in is 'robocopy.exe' or just 'robocopy' - it's not recognising the rest of the string at all! The only thing I changed from your original was, since I'm only using the parameter /MIR it was actually shorter and easier to just put that on the end of the line rather than use the roboparms bit.

    Where am I going wrong, please?!
    Beryl M


  8. #8
    Platinum Lounger
    Join Date
    Jan 2001
    Location
    Quedgeley, Gloucester, England
    Posts
    5,333
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Create s/cut to run CMD line (WinXP SP1)

    Beryl

    You spotted the deliberate mistake, where I put /mirror instead of /mir!

    Rather than debug via the website, I'll send you a Private Message...

    John
    <font face="Script MT Bold"><font color=blue><big><big>John</big></big></font color=blue></font face=script>

    Ita, esto, quidcumque...

  9. #9
    Gold Lounger
    Join Date
    Feb 2003
    Location
    Wardrobe Malfunction Junction, Derry
    Posts
    2,953
    Thanks
    0
    Thanked 0 Times in 0 Posts

  10. #10
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Create s/cut to run CMD line (WinXP SP1)

    Thanks for that, SMBP - as soon as I get a moment I'm going to sit down and go through them! It's obviously been far too long since I've done anything on this subject ...!
    Beryl M


Posting Permissions

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