Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Sudden mystery command line malfunction


  • Please log in to reply
10 replies to this topic

#1 Geoffc

Geoffc

  • Members
  • 92 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Warragul, Australia
  • Local time:06:01 PM

Posted 29 April 2013 - 01:17 AM

Maybe this belongs in the DOS forum.

For about ten years, I've run a "second guess" batch backup program to save changes of some key directory areas, monthly.  OS is XP Home.  Suddenly, today, the command XCOPY "is not recognized as an internal or external command, operable .." etc.  Typical trouble statements in this program today are:

..

Echo        Backing up my current unprocessed downloads.
md E:\Archives\Stash\History\Download
XCOPY "c:\Download\*.*" E:\Archives\Stash\History\Download /D:%1 /S /V /K
..

 

%1 contains the prior backup date from which to copy, usually about a month ago, entered manually at the command prompt.

 

The batch program has not been changed in years. In this environment, the only suspicion I can see is the few Microsoft updates that I see (and allow to be) automatically applied almost every day recently.  Could this be a corruption in my OS?  Or what else?

 


I'm lazy, memory's cheap, and after ten years, I'm happy to live with this code until it dies.  Any suggestions on why it suddenly quits would be warmly welcome!

 

:lmao:



BC AdBot (Login to Remove)

 


#2 FlannelBack

FlannelBack

  • Members
  • 327 posts
  • OFFLINE
  •  
  • Local time:03:01 AM

Posted 29 April 2013 - 04:19 AM

Try changing the line to:

%SystemRoot%\system32\xcopy.exe "c:\Download\*.*" E:\Archives\Stash\History\Download /D:%1 /S /V /K

or to:

C:\WINDOWS\system32\xcopy.exe "c:\Download\*.*" E:\Archives\Stash\History\Download /D:%1 /S /V /K

You could also try putting a copy of xcopy.exe in the same directory(folder) as the batch file.

Why it would suddenly stop recognizing the xcopy command, I don't know. Possibly one or more of these environment variables have changed:
 

Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem
SystemDrive=C: <-(not likely to be this one)
SystemRoot=C:\WINDOWS
windir=C:\WINDOWS

To check, open a command prompt window and type set(no parameters) and press "Enter".
The xcopy.exe file hasn't gone missing has it?



#3 Geoffc

Geoffc
  • Topic Starter

  • Members
  • 92 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Warragul, Australia
  • Local time:06:01 PM

Posted 29 April 2013 - 09:09 PM

Super solution, FlannelBack: many thanks.  Either of your suggested line changes resolved this problem. 

 

Does look like an environment variable issue; I checked all your pointers, but the only "strange" discovery was a PATH statement, copied on the doc attached.

 

I thought practically everything that runs is deliberately located in \Program Files, and see that Program Files isn't even in the PATH statement.  Are these references to program names in \Program Files really likely to be necessary, especially the duplicates?  If not necessary, what if anything do they cost?

 

If it ain't broke, don't fix itAttached File  Malfunction.bmp   334.57KB   2 downloads.



#4 FlannelBack

FlannelBack

  • Members
  • 327 posts
  • OFFLINE
  •  
  • Local time:03:01 AM

Posted 30 April 2013 - 02:55 AM

Most applications, by default, create and then install in a sub-folder of "C:\Program Files".  This can usually be changed during installation if desired.

The only possible duplicates I see(but I'm going cross-eyed tonight) are:
 

C:\Program Files\Calebre2;
and
C:\Program Files\Calebre2\;


I would prefer to see(at least in your case):

Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\Wbem;
instead of
Path=%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\system32\wbem;

Your "Path" statement has been modified(probably during installation) of the applications/utilities listed in the "Path" statement, IsoBuster, QuickTime and Calibre2 for example. What I'm not sure of is why. I've had some of those programs installed and my "Path" statement was not changed. In the days of DOS I understood but in these days I don't see the reason, although there must be one.

I have to admit too, that I don't recall ever seeing the:

C:\Documents and Settings\brandname_Owner\Local Settings\Application Data

folder listed in the "Path" statement.

Since this just started suddenly, did you just install one of those programs listed in the "Path"? Or more likely did one of them just update?

One other thing, I didn't do a "character count" but I believe the "Path" statement is limited to 255 characters in length. Your "Path" statement seems rather long.  There are ways around this limitation but they shouldn't be needed.

"If not necessary, what if anything do they cost?" I don't quite understand this question. :blush: If you mean resources and time, well it caused you to have to research the problem and then make corrections in something that's been working for roughly ten years. And it may cause other problems for you further down the road.

Maybe someone will step in and give a better explination. <--(hopefully)



#5 Geoffc

Geoffc
  • Topic Starter

  • Members
  • 92 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Warragul, Australia
  • Local time:06:01 PM

Posted 01 May 2013 - 01:40 AM

Hey, thanks, FlannelBack.  To the core of your treasured comments, I'm getting really tired of the trend towards frequent minor upgrades, and note that a week ago I let Calibre do an upgrade that scoped (file size) and timed more like a full re-instal.  Who knows what else ... ?

 

You do understand that question of mine: none of these mysteries amount to good or harmless developments.  Eternal vigilance.

 

I made the PATH changes you suggested, and we both know I'll need to watch out for months for unintended consequences.  I've cut out the two apparent duplicate entries too (those without the terminating backslash) and will watch for results.

 

Really appreciate your quality and quantity contribution.  We both expect overview by others who still remember what DOS stands for.



#6 FlannelBack

FlannelBack

  • Members
  • 327 posts
  • OFFLINE
  •  
  • Local time:03:01 AM

Posted 01 May 2013 - 12:22 PM

If Calibre is the culprit and you have removed both the Calibre references from the "Path", Calibre may decide not to function properly. Give it a run-through and see what happens.

If Calibre still works fine, then as suspected the references in the "Path" weren't necessary. If it glitches or fails miserably, put one of the Calibre references back in the "Path".

Check the "Shortcut" properties for Calibre. In the properties window under the "Shortcut" tab, you should see a "Target:" line giving the actual path of the ".exe" to execute. In the "Start in:" line the folder(directory) name should be declared that Calibre should run from.

Generally the "Start in:" line reads the same as the "Target:" line except for the designation of the actual file name(*.exe) to be executed. Example:

Target: "C:\Program Files\Program Name\Program.exe"
Start in: "C:\Program Files\Program Name"

 

It's important to note though that some applications might not be installed under "C:\Program Files".

They could for example be installed under "E:\My Apps" if such exist. So the "Target:" and the "Start in:" lines would read something like this:

Target: "E:\My Apps\Program Name\Program.exe"
Start In: "E:\My Apps\Program Name"

 

Yup. You're absolutely correct, constant vigilance is a necessity. The automatic updates that happen in the background are the ones that seem to cause the problems. But we stray from the immediate issue.

Try some of your other applications/utilities that you normaly run but maybe not on a frequent basis. See if all is well.

 



#7 Geoffc

Geoffc
  • Topic Starter

  • Members
  • 92 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Warragul, Australia
  • Local time:06:01 PM

Posted 03 May 2013 - 02:23 AM

Hello again, FlannelBack. 

I'm keen to explore some diagnostics you suggested but cannot find how to edit my computer's PATH statement.  Naively, I retyped a changed version at the DOS prompt, wasted hours of testing before finding I'd changed nothing.  how can I enter edits to the PATH statement?  Happy to read a tech article if that's available.



#8 FlannelBack

FlannelBack

  • Members
  • 327 posts
  • OFFLINE
  •  
  • Local time:03:01 AM

Posted 03 May 2013 - 04:23 PM

Some questions if you don't mind:

  • Is there a Calibre icon(Shortcut) on your desk top or in the "Programs" list?
  • Did you try viewing/changing the icon(Shortcut) properties for Calibre?
  • What method do you use to launch/run programs/applications/utilities?

"I retyped a changed version at the DOS prompt," It really should be done from the "System Properties" Window.
 

Before changing the system environment variables, a registry back-up needs to be made. For Windows XP I like to use ERUNT. If you don't already have ERUNT, you can download it from the link above. I would use Server 2 listed in the second pane down on the left.

Alternatively you can download ERUNT from MajorGeeks_Erunt 1.1j

Once downloaded run(double-click) the "erunt-setup.exe" file. Or you can:

  • Press the [ Windows ]key + the [ R ]key.
  • In the Run dialogue box click the "Browse..." button.
  • Navigate to the location of the "erunt-setup.exe" file.
  • Highlight the file and click the "Open" button. The browsing window will close.
  • In the Run dialogue box the location/filename(the path) you highlighted is displayed.
  • Click the "OK" button.

By default it will create a folder(directory) named "ERUNT" in the "C:\Program Files" directory(folder). So now you will have a folder(directory) named "C:\Program Files\ERUNT". This is the folder the program will install to and run from.

It will also create a new folder(directory) in the "C:\WINDOWS" folder named "ERDNT". Now you'll have a "C:\WINDOWS\ERDNT" folder. This is the folder(directory) where ERUNT will place the registry back-up(s).

Once installed, look in the Start > "Programs" menu for the "ERUNT" folder icon(Shortcut) and hover the mouse cursor over it. A sub-menu with an "ERU NT" icon(Shortcut) will be listed. Click the "ERU NT" icon(Shortcut) to create a back-up of the registry.

Now for extra insurance a system "Restore Point" should also be set.

  • Click Start > Programs > Accessories > System Tools > System Restore
  • In the System Restore window, click the "Create a restore point" radio button.
  • At the bottom of the "System Restore" window click the "Next >" button.
  • In the "Restore point description:" textarea type a name like "ChangePath"
  • At the bottom of the window click the "Create" button.
  • After a moment a "Restore Point Created" confirmation window will pop-up.
  • Click the "Close" button at the bottom of the confirmation window.

I realize this all seems mundane and lengthy but it needs to be done before any changes are made to the system. Just in case something goes wrong during those changes, the system can be restored to the previous state. I go through this routine everytime I install something new or perform some program upgrade. Think it would be a good idea for you to do so too. Others may have a better method but this is the one that works for me.

You were right in your earlier post. There are two paths that are duplicated:

C:\Program Files\QuickTime\QTSystem\
C:\Program Files\Calibre2\

There should only be one of each.

We'll deal with the icons(Shortcuts) properties and the "Path" environment variable once you have the registry back-up and restore point set.

In the meantime here are few articles to give you an idea of what we're dealing with. It's really simple to do but it must be done meticulously.

Microsoft Windows XP - Path
How To Manage Environment Variables in Windows XP
and finally,
PATH (variable) - Wikipedia, the free encyclopedia

I think part of your problem is, you're trying these changes in a "Command prompt" window. Problem is, you're not really in DOS when you open a "Command prompt" window. You're working in a Windows "DOS work-a-like" mode or a DOS compatibility mode so to speak.

 

 


Edited by FlannelBack, 03 May 2013 - 06:30 PM.


#9 Geoffc

Geoffc
  • Topic Starter

  • Members
  • 92 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Warragul, Australia
  • Local time:06:01 PM

Posted 03 May 2013 - 10:35 PM

WOW, FlannelBack; you're doing as much work as, if not more than, I am on this anomaly.  And I'm really grateful.

 

Your queries:

Calibre shortcuts in the Programs list and on desktop -  Yes, both.

Have viewed Properties: Target looks OK, but there's no "Start In" entry. Checked around the desktop, and found 50:50 odds whether they have a Start In; and when they do, its content complies with your earlier description, and so I treated Start In as an optional extra, not worth playing with.  Left the Properties unaltered.

To launch: In order of preference, click on icon in the "Fast Start" group which I limit to about 10 high-use items; Doubleclick on a desktop icon, one of 65 that I keep in view there; Otherwise Start - All Programs, find and click.

Need to use System Properties? Verdammt!  I remember a change, maybe 7-8 years ago, perhaps with upgrade to XP, from real DOS to a simulation, but some of the implications were - and are - over my head.  Now, back on planet Earth, .....

 

Installed and ran ERU NT, backed up the Registry, no problem. Don't mention "mundane", I'm well aware the Registry demands MAJOR respect, though my system seems to be godfathering me: there were already 26 Restore points on file back to Apr 1st, the most recent 20 being called "System Checkpoints".  No sweat: 50% of my memory  (150-odd Gig) is available.

 

This message is interim: I've got some reading homework to do.

 

Geoffc



#10 Geoffc

Geoffc
  • Topic Starter

  • Members
  • 92 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Warragul, Australia
  • Local time:06:01 PM

Posted 04 May 2013 - 12:43 AM

Reading was valuable.

Bearing that in mind, I removed all reference in my PC's PATH statement to Calibre & Isobuster, and uninstalled BOX Edit which seemed to have snuck in with BOX Sync.  I've left the Apple QT reference alone, because their (Reader and Pictures) properties were not adequately specific to be comfortable with any action by me.  Anyway, that PATH statement is now about 220 characters.

Tested every action I could think of, with no sign of mal- or non-function. Installed a new Calibre upgrade (Bless 'em!)

, explored, inspected and tested some more - ho hum, no variant behaviour still.

My original DOS issue is kilt ded, and I'm a lot more educated.

 

Thanks again.

 

GeoffC



#11 FlannelBack

FlannelBack

  • Members
  • 327 posts
  • OFFLINE
  •  
  • Local time:03:01 AM

Posted 04 May 2013 - 01:48 AM

"Tested every action I could think of, with no sign of mal- or non-function. Installed a new Calibre upgrade (Bless 'em!)
, explored, inspected and tested some more - ho hum, no variant behaviour still.
" :thumbup2:  Well done!

 

You're quite welcome.

 

And it wasn't much work.  Just had to put some oil on my rusty brain.


Edited by FlannelBack, 04 May 2013 - 01:52 AM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users