Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Windows Command Prompt


  • Please log in to reply

#1
evovove

evovove

    Member

  • Member
  • PipPip
  • 23 posts
Hi,

Im running Win XP Pro and I rather frequently use cmd.exe and today i opened it up and entered in some commands and whatever command i entered it returned an error message, for example: " 'ipconfig' is not recognized as operable program or batch file. ". Any help would be greatly appreciated, thanks in advance.

-evo

Posted Image
  • 0

Advertisements


#2
Johanna

Johanna

    The Leather Lady

  • Moderator
  • 3,038 posts
http://www.kellys-ko...m/xp_tweaks.htm
scroll down to line 228, right hand side.

Johanna
  • 0

#3
evovove

evovove

    Member

  • Topic Starter
  • Member
  • PipPip
  • 23 posts
I have just realised that my cmd works when the directory that you type commands into is set as %SYSTEMROOT%\system32 which in my case is 'C:\WINDOWS\system32' any other directory and cmd will return the error message i stated earlier. I tried the cmd restore thing but it did the same thing, im guessing it could be a registry problem? Any more suggestions?

Thanks, evo

Posted Image
  • 0

#4
Irongeek

Irongeek

    banned

  • Banned
  • PipPip
  • 82 posts
I would recommend trying; c:\windows\system32\ipconfig /all <--from the command prompt. Also,

Options:
/? Display this help message
/all Display full configuration information.
/release Release the IP address for the specified adapter.
/renew Renew the IP address for the specified adapter.
/flushdns Purges the DNS Resolver cache.
/registerdns Refreshes all DHCP leases and re-registers DNS names
/displaydns Display the contents of the DNS Resolver Cache.
/showclassid Displays all the dhcp class IDs allowed for adapter.
/setclassid Modifies the dhcp class id.
  • 0

#5
Johanna

Johanna

    The Leather Lady

  • Moderator
  • 3,038 posts
I would right click on the network icon, choose properties and click repair, rather than opening a cmd window, but since your cmd seems to be broken, I would head to G2G Malware Forum for a checkup.

Have you tried an sfc /scannow with your XP cd?

Johanna
  • 0

#6
evovove

evovove

    Member

  • Topic Starter
  • Member
  • PipPip
  • 23 posts
Well my cmd works but only in the correct directory i hope these images help articulate what my problem is.

Posted Image
Posted Image

as you can see the commands work in the system32 directory, its very annoying having to chgange the directory in order to use cmd. could it be a registry issue or some corruption?

thanks again, evo

Posted Image
  • 0

#7
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 876 posts
check 'path' in system variables:

right click my computer>properties>advanced>environment variables

see if c:\windows\system32 is included in the path variable definition

additional info:
path variable
  • 0

#8
evovove

evovove

    Member

  • Topic Starter
  • Member
  • PipPip
  • 23 posts
System32 was a path in the system variables, any other ideas?

-evo

Posted Image
  • 0

#9
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 876 posts
there's one other test for the variable 'path'. enter the word path on the command line of a cmd.exe window, then verify c:\windows\system32 is included in the result.
  • 0

#10
evovove

evovove

    Member

  • Topic Starter
  • Member
  • PipPip
  • 23 posts
yeh it was included, heres the results:
C:\Documents and Settings\ebyatt>path
PATH=C:\PROGRAM FILES\BORLAND\DELPHI7\BIN;C:\PROGRAM FILES\BORLAND\DELPHI7\PROJE
CTS\BPL\;%SYSTEMROOT%\SYSTEM32;%SYSTEMROOT%;%SYSTEMROOT%\SYSTEM32\WBEM;C:\WINDOW
S\SYSTEM32\WSG32\

Anyone have any ideas/thoughts as to why cmd only works in that path?

thanks, eVo
  • 0

Advertisements


#11
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 876 posts
the purpose of the variable 'path' is to eliminate the need of doing a 'cd' to the folders listed in 'path' when entering commands in a cmd.exe window. it appears that c:\windows\system32 is included in the variable 'path' as it is currently defined. let's see if adding c:\windows\system32 to 'path' makes any difference.

two suggestions at this point:
append c:\windows\system32 to the current definition of 'path'. then open a new cmd.exe window and test. type path and view the new definition to verify c:\windows\system32 is now defined in the variable 'path'. then test some of the commands.

the new definition will look like this:
PATH=C:\PROGRAM FILES\BORLAND\DELPHI\BIN;C:\PROGRAMFILES\BORLAND\DELPHI7\PROJECTS\BPL\;%SYSTEMROOT%\SYSTEM32;%SYSTEMROOT%;%SYSTEMROOT\SYSTEM32\WBEM;C:\WINDOWS\SYSTEM32\WSG\;c:\windows\system32

do not forget the ';' when adding c:\windows\system32

-----------------------------------------------

idea #2 - if the above does not work, try adding c:\windows\system32 prior to %systemroot%\system32

PATH=C:\PROGRAM FILES\BORLAND\DELPHI\BIN;C:\PROGRAMFILES\BORLAND\DELPHI7\PROJECTS\BPL\;c:\windows\system32;%SYSTEMROOT%\SYSTEM32;%SYSTEMROOT%;%SYSTEMROOT\SYSTEM32\WBEM;C:\WINDOWS\SYSTEM32\WSG32\
  • 0

#12
evovove

evovove

    Member

  • Topic Starter
  • Member
  • PipPip
  • 23 posts
hi,

i typed 'path C:\PROGRAM FILES\BORLAND\DELPHI\BIN;C:\PROGRAMFILES\BORLAND\DELPHI7\PROJECTS\BPL\;%SYSTEMROOT%\SYSTEM32;%SYSTEMROOT%;%SYSTEMROOT\SYSTEM32\WBEM;C:\WINDOWS\SYSTEM32\WSG\;c:\windows\system32' and it added system32 to the path and i then tested commands such as the net user %username% and it worked perfectly however as soon as i closed cmd and opened it up again to check weather it was permanently fixed and it did not recognize the commands.
im sure this means we're on the right track :tazz:.
how can we make it so that system32 is permanently in the path?

thanks heaps, eVo
  • 0

#13
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 876 posts
please look at the 'path variable' link in post #7
  • 0

#14
evovove

evovove

    Member

  • Topic Starter
  • Member
  • PipPip
  • 23 posts
Hi,

i added C:\WiNDOWS\sytem32 to the environmental variables path, although it was already there and it seems to have fixed the problem completely, as soon as i open cmd i can enter any command with a change of directory. thank you for all your help!

eVo
  • 0

#15
bdlt

bdlt

    Member

  • Member
  • PipPipPip
  • 876 posts
you're welcome. thanks for letting us know the results.

there is an underlying problem that still exists, however. for some reason %systemroot% is recognized in the cmd.exe window and 'path' appears to be properly defined using %systemroot%, but for some unknown reason does not appear to work until you hard coded the path(C:\windows\system32). I'm not sure where to look to correct this problem.

if this were my PC, I would leave it as it is, since it appears to be working. one thing we did not check was the value of systemroot. from your screen shot, it appears to be defined as c:\windows and worked when you used the cd command. if you are curious enter the following line in a cdm.exe window:

echo %systemroot%

the expected result is c:\windows

should you decide to leave everything as is(again, my recommendation) be aware of any other strange activiy on your PC. it's possible that you've got a bug that may show up with similar symptoms.

good luck,

John
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP