Re: Shell function strange behaviour



Hi Chris - This is what i have tried:

Shell "cmd /k c:\WINDOWS\System32\sample.bat"
-AND-
Shell "c:\WINDOWS\System32\cmd /k sample.bat"
-AND-
Shell "c:\WINDOWS\System32\cmd /k c:\WINDOWS\System32\sample.bat"

The result is still the same :-(

'c:\WINDOWS\System32\sample.bat' is not recognized as an internal or
external command, operable program or batch file.

I use the '/k' so the command windows is kept open; and on every
instance, doing a DIR on C:\WINDOWS\System32 for sample.bat brings no
results even though the file is there.
BTW, 'cmd.exe' it's on the same folder so I am really struggling to
understand what's going on.

Furthermore, the Start > Run > cmd will show this PATH:
PATH=C:\Program Files (x86)\PC Connectivity Solution\;C:\WINDOWS
\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files
(x86)\ATI Technologies\ATI.ACE\Core-Static;C:\WINDOWS\sysWOW64

And the Shell "cmd /k" will show a different PATH (as you correctly
suggested) but that still contains C:\WINDOWS\System32:
PATH=C:\Program Files (x86)\Microsoft Office\OFFICE11\;C:\Program
Files (x86)\PC Connectivity Solution\;C:\WINDOWS\system32;C:\WINDOWS;C:
\WINDOWS\System32\Wbem;C:\Program Files (x86)\ATI Technologies\ATI.ACE
\Core-Static;C:\WINDOWS\sysWOW64

I have even set the PATH temporarily to only look at C:\WINDOWS
\System32 but the result is the same.

It looks that there must be some permission issue for sample.bat when
it is placed on the System32 folder; so when Shell "cmd /k" is
executed somehow it is not authorised to 'see' that sample.bat is in
System32.

However, if I place sample.bat on i.e. C:\ then the problem is gone.

.



Relevant Pages

  • RE: Error in Event Viewer - Active in HAT
    ... unfortunately I get this error when I start the trace. ... 'tracelog.exe' is not recognized as an internal or external command, ... operable program or batch file. ...
    (microsoft.public.biztalk.general)
  • Re: Clock on pc time loss
    ... Here are all the cmd replies ... operable program or batch file. ... 'cmd' is not recognized as an internal or external command, ... The Windows Time service was stopped successfully. ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: All DHCP Servers Info HELP!
    ... Recieved bunch of errors. ... ''' is not recognized as an internal or external command, ... operable program or batch file. ...
    (microsoft.public.windows.server.active_directory)
  • xcopy is not recognized as an internal or external command
    ... operable program or batch file. ... 'C:\xcopy' is not recognized as an internal or external command, ... Munging English.cfg ...
    (microsoft.public.windowsxp.general)
  • Re: Clock on pc time loss
    ... operable program or batch file. ... 'cmd' is not recognized as an internal or external command, ... The Windows Time service was stopped successfully. ...
    (microsoft.public.windowsxp.help_and_support)

Loading