Results 1 to 7 of 7
  1. #1
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why does Windows REM out the COPY statement?

    (The Lounge seems to Barf on percent signs; I've replaced all percent signs with exclamation marks)

    I've been puzzled by this for a while: each time I reinstall Win98SE, it ferrets out my humble BATch files and does a number on them.

    My AutoExec,BAT merely points to AutoDos.BAT, which holds the main event.

    AutoDos.bat (attached) makes a call to WallPap2.bat (reproduced below), which has the innocuous job of using the time of re-boot to select a different wallpaper.

    Here's the catch: Windows REMs out the COPY statement (immediately below the label "80Found").

    Why would Windows work it's sordid way through my batch files and then decide that a COPY statement is suspect? It's three levels deep here - so it's not just a case of inspecting AutoExec.bat "just in case"; there's some serious analysis going on.



    <pre>REM WallPaper.bat Chris Greaves Friday, August 24, 2001
    ::
    :: reset the desktop wallpaper.
    if "!debug!"=="" set debug=off
    @echo !debug!

    call c:batsettime

    set WallRoot=c:GREAVESPRODUCTSUSERwallptarget

    set WallPaper=!WallRoot!00!mn!!se!!.bmp
    if exist !Wallpaper! goto 80Found

    @echo Couldn't Find !wallpaper!
    :: wait 1
    !0
    :::goto 90NoChange

    :80Found
    rem - By Windows Setup - copy !Wallpaper! c:imagesbitmapsdaily.bmp > nul
    log -t !wallpaper!

    echo c:windowspbrush.exe !wallpaper! > c:batwallcolr.bat

    :: but just in case we don't like it, be ready to delete it from the desktop
    echo del !wallpaper! > c:batwallpera.bat
    echo c:batwallpap2.bat >> c:batwallpera.bat
    @echo !wallpaper!

    :90NoChange
    :99Exit

    REM end of Wallpape.bat
    </pre>

    Attached Files Attached Files

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Why does Windows REM out the COPY statement?

    Chris, I'm over my head when it comes to batch files. But I notice that Win 98 rems out everything from AutoExec.bat. I think it was an attempt to move away from DOS (again, DOS is over my head). <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Why does Windows REM out the COPY statement?

    Thanks, Phil.

    I know it's a bit late to be worrying about Win98, too.

    I could understand Win REMing everything in my Autoexec.BAT, but it doesn't do that.
    I could understand Win REM ing everything in every other AUTO*.BAT ("Well, you can't be too sure ....."), but it doesn't do that.

    It REMs a single COPY statement in a 3rd-level batch file.

    Here's what I'll do (and I'm not even sure if this is worth the time), I'll add a few harmless COPY statements to my 1st-level AutoExec.BAT, the 2nd-level AutoDOS.BAT it calls, and the 3rd-level WallPap2.BAT that it calls, and then wait until (sigh) I reload Win98.

    I posted just in case anyone else had noticed this rather odd behaviour.

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

    Re: Why does Windows REM out the COPY statement?

    Chris

    You clearly know what you're doing in BATch files! I have never heard of the behaviour you experience. I would investigate further by trying:
    a) running AUTOEXEC.BAT from a Command Prompt window (i.e. NOT at boot time). Any differences?
    [img]/forums/images/smilies/cool.gif[/img] does anything happen if you make the offending file Read Only?
    c) replace the COPY command by XCOPY (assuming the correct path...) using the correct parameters
    d) duplicate the COPY command - do both instances get REMmed?

    We'll never be out of a job with computers...!

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

    Ita, esto, quidcumque...

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Why does Windows REM out the COPY statement?

    Hi Chris

    Just a random thought. Why not move the 3rd level batch file to some innocuous folder, appropriately changing the reference to it in the calling batch file, and see if Windows digs down to the extent of finding it and REMing it. Might give a bit more insight into what's going on.

    Alan

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Why does Windows REM out the COPY statement?

    > I would investigate further by trying

    John, thanks for these tips. I'm going to edit them *and* the message link into my boot sequence. The behaviour I'm describing seems to occur when I do a clean install (for me, deleting C:windows and re-installing, rather than just installing over the previous copy), so it likely won't recur for another 9 or more months.

    But when it does we'll spring the trap and report back!

  7. #7
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Why does Windows REM out the COPY statement?

    > Why not move the 3rd level batch file to some innocuous folder,

    Alan thanks for this sugegstion; please see also my response to John.

    Insight into what's going on would be useful in understanding it. I'm puzzled that, apparently, I'm the only one who seems to experience it.

Posting Permissions

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