Re: objWshell.Run "%COMSPEC% /C ren topoX.jpg topo_cliente.jpg", 0, TRUE ???

From: Aaron Bertrand [MVP] (aaron_at_TRASHaspfaq.com)
Date: 03/04/04


Date: Thu, 4 Mar 2004 11:11:46 -0500

Too lazy to try, but can you use %sysdir% or %systemroot% in the definition
of another environment variable? I'm not sure if the variables are
initialized in order or en masse... but it's not like that value is going to
change in the existing environment anyway.

-- 
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
"Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> wrote in
message news:%23Di7ZDfAEHA.2660@TK2MSFTNGP10.phx.gbl...
> %compspec% isn't a command.  It's an environment variable that represents
> the path to your command interpreter executable, cmd.exe.
>
> Right click My Computer
> Click Properties
> Advanced tab
> Environment Variables
>
> In the System Variables box, ComSpec should be the first one listed, on a
> default W2K Server.  If it is not there, add it.
>
> Variable name:  ComSpec
> Variable value:  C:\Winnt\System32\cmd.exe
>
>
> Note that for that value, this is for a W2K Server installed on C with a
> %systemroot% of C:\Winnt.  If you have no environment variables at all,
you
> may want to inquire about this in microsoft.public.win2000.general or
> .win2000.cmdprompt.admin.
>
> Ray at work
>
> "Vilmar Brazão de Oliveira" <teste@teste.teste.teste> wrote in message
> news:u2oQb4eAEHA.212@TK2MSFTNGP12.phx.gbl...
> > Hi all,
> > I was using:
> > <% Set objWshell = Server.CreateObject("WScript.Shell")
> > objWshell.Run "%COMSPEC% /C ren topoX.jpg topo_cliente.jpg", 0, TRUE %>
> >
> > BUT the comand COMSPEC disapeared of all my machines which we have
> > ms-windows 2000 installed!
> > So now no-one machine can continue run my routines which accessed ms-dos
> by
> > ASP
> >
> > COULD anybody send me the comspec command by e-mail whith the subject:
> > Comspec to WScript.Shell
> > ???
> >
> > obs.:I got these samples in aspfaq.com »»
> > http://www.aspfaq.com/show.asp?id=2059
> > thanks,
> > --
> >
> > Sem mais,
> >
> > ««««««««»»»»»»»»»»»»»»
> > Vlmar Brazão de Oliveira
> > Desenvolvimento Web
> > HI-TEC
> >
> >
>
>


Relevant Pages

  • Re: Need help with command prompt path
    ... entry that defines your path is of the wrong type. ... Check your %SystemRoot% and %System% settings by opening a command ... environment variables press Return to get next line, ...
    (microsoft.public.windowsxp.general)
  • Re: Need help with command prompt path
    ... Check your %SystemRoot% and %System% settings by opening a command ... window and entering the command ... ... environment variables press Return to get next line, ...
    (microsoft.public.windowsxp.general)
  • Re: Need help with command prompt path
    ... I access command prompt by clicking 'Start, ... Check your %SystemRoot% and %System% settings by opening a command ... environment variables press Return to get next line, ...
    (microsoft.public.windowsxp.general)
  • Re: Need help with command prompt path
    ... Command Prompt then you're supposed to get a fully ... Check your %SystemRoot% and %System% settings by opening a command ... environment variables press Return to get next line, ...
    (microsoft.public.windowsxp.general)
  • Re: objWshell.Run "%COMSPEC% /C ren topoX.jpg topo_cliente.jpg", 0, TRUE ???
    ... If %COMSPEC% keeps away the path of command interpreter why my ASP routines ... > variable like %windir% is actually %systemroot%. ... >>> Environment Variables ... >>> Ray at work ...
    (microsoft.public.inetserver.asp.general)