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

Discussion in 'ASP General' started by Vilmar Brazão de Oliveira, Mar 4, 2004.

  1. 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
    Vilmar Brazão de Oliveira, Mar 4, 2004
    #1
    1. Advertising

  2. Vilmar Brazão de Oliveira

    Ray at Guest

    %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" <> wrote in message
    news:...
    > 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
    >
    >
    Ray at, Mar 4, 2004
    #2
    1. Advertising

  3. 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:%...
    > %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" <> wrote in message
    > news:...
    > > 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
    > >
    > >

    >
    >
    Aaron Bertrand [MVP], Mar 4, 2004
    #3
  4. Vilmar Brazão de Oliveira

    Ray at Guest

    I do believe that you can, because the actual value of an environment
    variable like %windir% is actually %systemroot%. But, since it's stored as
    a REG_EXPAND_SZ, when you view the variable anywhere, the expanded value of
    %systemroot% is what's displayed.

    And %comspec% is actually %systemroot%\system32\cmd.exe. So, I guess I gave
    false instructions about recreating that variable. Sorry Vilmar.

    I guess if the var is stored as a REG_SZ, you'd have to type the literal
    path.

    Ray at work

    "Aaron Bertrand [MVP]" <> wrote in message
    news:...
    > 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:%...
    > > %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" <> wrote in message
    > > news:...
    > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
    Ray at, Mar 4, 2004
    #4
  5. Hi all,
    I have tried:
    objWshell.Run "%systemroot%\system32\cmd.exe /C ren topoX.jpg
    topo_cliente.jpg", 0, TRUE\cmd.exe

    objWshell.Run "c:\winnt\\system32\cmd.exe /C ren topoX.jpg
    topo_cliente.jpg", 0, TRUE\cmd.exe

    But nothing is running well!
    If %COMSPEC% keeps away the path of command interpreter why my ASP routines
    can not execute the WSH correctly??

    Thanks untill here,
    --

    ««««««««»»»»»»»»»»»»»»
    Vlmar Brazão de Oliveira
    Desenvolvimento Web
    HI-TEC

    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> escreveu na
    mensagem news:...
    > I do believe that you can, because the actual value of an environment
    > variable like %windir% is actually %systemroot%. But, since it's stored

    as
    > a REG_EXPAND_SZ, when you view the variable anywhere, the expanded value

    of
    > %systemroot% is what's displayed.
    >
    > And %comspec% is actually %systemroot%\system32\cmd.exe. So, I guess I

    gave
    > false instructions about recreating that variable. Sorry Vilmar.
    >
    > I guess if the var is stored as a REG_SZ, you'd have to type the literal
    > path.
    >
    > Ray at work
    >
    > "Aaron Bertrand [MVP]" <> wrote in message
    > news:...
    > > 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:%...
    > > > %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" <> wrote in message
    > > > news:...
    > > > > 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
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Vilmar Brazão de Oliveira, Mar 4, 2004
    #5
  6. Vilmar Brazão de Oliveira

    Ray at Guest

    Did you read anything in my first post about checking your environment
    variables?

    Ray at work

    "Vilmar Brazão de Oliveira" <> wrote in message
    news:...
    > Hi all,
    > I have tried:
    > objWshell.Run "%systemroot%\system32\cmd.exe /C ren topoX.jpg
    > topo_cliente.jpg", 0, TRUE\cmd.exe
    >
    > objWshell.Run "c:\winnt\\system32\cmd.exe /C ren topoX.jpg
    > topo_cliente.jpg", 0, TRUE\cmd.exe
    >
    > But nothing is running well!
    > If %COMSPEC% keeps away the path of command interpreter why my ASP

    routines
    > can not execute the WSH correctly??
    >
    > Thanks untill here,
    > --
    >
    > ««««««««»»»»»»»»»»»»»»
    > Vlmar Brazão de Oliveira
    > Desenvolvimento Web
    > HI-TEC
    >
    > "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> escreveu na
    > mensagem news:...
    > > I do believe that you can, because the actual value of an environment
    > > variable like %windir% is actually %systemroot%. But, since it's stored

    > as
    > > a REG_EXPAND_SZ, when you view the variable anywhere, the expanded value

    > of
    > > %systemroot% is what's displayed.
    > >
    > > And %comspec% is actually %systemroot%\system32\cmd.exe. So, I guess I

    > gave
    > > false instructions about recreating that variable. Sorry Vilmar.
    > >
    > > I guess if the var is stored as a REG_SZ, you'd have to type the literal
    > > path.
    > >
    > > Ray at work
    > >
    > > "Aaron Bertrand [MVP]" <> wrote in message
    > > news:...
    > > > 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:%...
    > > > > %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" <> wrote in

    message
    > > > > news:...
    > > > > > 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
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Ray at, Mar 4, 2004
    #6
  7. Hi,
    I read all the last posts. Again: thanks for them.
    Here is all the system variable which my o.s. ms-windows 2000 produces:
    C:\>set
    ALLUSERSPROFILE=C:\Documents and Settings\All
    APPDATA=C:\Documents and Settings\rute\Dados d
    CommonProgramFiles=C:\Arquivos de programas\Ar
    COMPUTERNAME=SUP14
    ComSpec=C:\WINNT\system32\cmd.exe
    HOMEDRIVE=N:
    HOMEPATH=\
    HOMESHARE=\\Webserver\d$
    LOGONSERVER=\\SUP14
    NUMBER_OF_PROCESSORS=1
    OS=Windows_NT
    Os2LibPath=C:\WINNT\system32\os2\dll;
    Path=C:\Arquivos de programas\Borland\Delphi5\
    WINNT\System32\Wbem
    PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE
    PROCESSOR_ARCHITECTURE=x86
    PROCESSOR_IDENTIFIER=x86 Family 6 Model 4 Step
    PROCESSOR_LEVEL=6
    PROCESSOR_REVISION=0404
    ProgramFiles=C:\Arquivos de programas
    PROMPT=$P$G
    SystemDrive=C:
    SystemRoot=C:\WINNT
    TEMP=C:\DOCUME~1\rute\CONFIG~1\Temp
    TMP=C:\DOCUME~1\rute\CONFIG~1\Temp
    USERDOMAIN=SUP14
    USERNAME=rute
    USERPROFILE=C:\Documents and Settings\rute
    windir=C:\WINNT

    So what shoud I do??
    thanks all,
    --

    ««««««««»»»»»»»»»»»»»»
    Vlmar Brazão de Oliveira
    Desenvolvimento Web
    HI-TEC
    "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> escreveu na
    mensagem news:u#...
    > Did you read anything in my first post about checking your environment
    > variables?
    >
    > Ray at work
    >
    > "Vilmar Brazão de Oliveira" <> wrote in message
    > news:...
    > > Hi all,
    > > I have tried:
    > > objWshell.Run "%systemroot%\system32\cmd.exe /C ren topoX.jpg
    > > topo_cliente.jpg", 0, TRUE\cmd.exe
    > >
    > > objWshell.Run "c:\winnt\\system32\cmd.exe /C ren topoX.jpg
    > > topo_cliente.jpg", 0, TRUE\cmd.exe
    > >
    > > But nothing is running well!
    > > If %COMSPEC% keeps away the path of command interpreter why my ASP

    > routines
    > > can not execute the WSH correctly??
    > >
    > > Thanks untill here,
    > > --
    > >
    > > ««««««««»»»»»»»»»»»»»»
    > > Vlmar Brazão de Oliveira
    > > Desenvolvimento Web
    > > HI-TEC
    > >
    > > "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> escreveu

    na
    > > mensagem news:...
    > > > I do believe that you can, because the actual value of an environment
    > > > variable like %windir% is actually %systemroot%. But, since it's

    stored
    > > as
    > > > a REG_EXPAND_SZ, when you view the variable anywhere, the expanded

    value
    > > of
    > > > %systemroot% is what's displayed.
    > > >
    > > > And %comspec% is actually %systemroot%\system32\cmd.exe. So, I guess

    I
    > > gave
    > > > false instructions about recreating that variable. Sorry Vilmar.
    > > >
    > > > I guess if the var is stored as a REG_SZ, you'd have to type the

    literal
    > > > path.
    > > >
    > > > Ray at work
    > > >
    > > > "Aaron Bertrand [MVP]" <> wrote in message
    > > > news:...
    > > > > 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:%...
    > > > > > %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" <> wrote in

    > message
    > > > > > news:...
    > > > > > > 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
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Vilmar Brazão de Oliveira, Mar 4, 2004
    #7
  8. Vilmar Brazão de Oliveira

    Ray at Guest

    Alright, your variables are cool then. (This is from your ~server~, right,
    not your workstation?) Now I can't remember how I determined or assumed
    that it might be a system variable problem to begin with!

    Are you able to log on to the server directly? If so, if you enter the same
    command at the command prompt (cmd.exe), does it work? That command being:

    ren topoX.jpg topo_cliente.jpg

    One other thing that I just noticed is that you aren't specifying the PATH
    to your file. I believe that cmd.exe will open in the user's home directory
    (IUSR's) or if the user doesn't have a home directory specified, it'll be
    the system32 directory. So, try:

    ren C:\Path\To\Your\File\topoX.jpg topo_cliente.jpg

    Ray at work

    "Vilmar Brazão de Oliveira" <> wrote in message
    news:...
    > Hi,
    > I read all the last posts. Again: thanks for them.
    > Here is all the system variable which my o.s. ms-windows 2000 produces:
    > C:\>set
    > ALLUSERSPROFILE=C:\Documents and Settings\All
    > APPDATA=C:\Documents and Settings\rute\Dados d
    > CommonProgramFiles=C:\Arquivos de programas\Ar
    > COMPUTERNAME=SUP14
    > ComSpec=C:\WINNT\system32\cmd.exe
    > HOMEDRIVE=N:
    > HOMEPATH=\
    > HOMESHARE=\\Webserver\d$
    > LOGONSERVER=\\SUP14
    > NUMBER_OF_PROCESSORS=1
    > OS=Windows_NT
    > Os2LibPath=C:\WINNT\system32\os2\dll;
    > Path=C:\Arquivos de programas\Borland\Delphi5\
    > WINNT\System32\Wbem
    > PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE
    > PROCESSOR_ARCHITECTURE=x86
    > PROCESSOR_IDENTIFIER=x86 Family 6 Model 4 Step
    > PROCESSOR_LEVEL=6
    > PROCESSOR_REVISION=0404
    > ProgramFiles=C:\Arquivos de programas
    > PROMPT=$P$G
    > SystemDrive=C:
    > SystemRoot=C:\WINNT
    > TEMP=C:\DOCUME~1\rute\CONFIG~1\Temp
    > TMP=C:\DOCUME~1\rute\CONFIG~1\Temp
    > USERDOMAIN=SUP14
    > USERNAME=rute
    > USERPROFILE=C:\Documents and Settings\rute
    > windir=C:\WINNT
    >
    > So what shoud I do??
    > thanks all,
    > --
    >
    > ««««««««»»»»»»»»»»»»»»
    > Vlmar Brazão de Oliveira
    > Desenvolvimento Web
    > HI-TEC
    > "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> escreveu na
    > mensagem news:u#...
    > > Did you read anything in my first post about checking your environment
    > > variables?
    > >
    > > Ray at work
    > >
    > > "Vilmar Brazão de Oliveira" <> wrote in message
    > > news:...
    > > > Hi all,
    > > > I have tried:
    > > > objWshell.Run "%systemroot%\system32\cmd.exe /C ren topoX.jpg
    > > > topo_cliente.jpg", 0, TRUE\cmd.exe
    > > >
    > > > objWshell.Run "c:\winnt\\system32\cmd.exe /C ren topoX.jpg
    > > > topo_cliente.jpg", 0, TRUE\cmd.exe
    > > >
    > > > But nothing is running well!
    > > > If %COMSPEC% keeps away the path of command interpreter why my ASP

    > > routines
    > > > can not execute the WSH correctly??
    > > >
    > > > Thanks untill here,
    > > > --
    > > >
    > > > ««««««««»»»»»»»»»»»»»»
    > > > Vlmar Brazão de Oliveira
    > > > Desenvolvimento Web
    > > > HI-TEC
    > > >
    > > > "Ray at <%=sLocation%> [MVP]" <myfirstname at lane34 dot com> escreveu

    > na
    > > > mensagem news:...
    > > > > I do believe that you can, because the actual value of an

    environment
    > > > > variable like %windir% is actually %systemroot%. But, since it's

    > stored
    > > > as
    > > > > a REG_EXPAND_SZ, when you view the variable anywhere, the expanded

    > value
    > > > of
    > > > > %systemroot% is what's displayed.
    > > > >
    > > > > And %comspec% is actually %systemroot%\system32\cmd.exe. So, I

    guess
    > I
    > > > gave
    > > > > false instructions about recreating that variable. Sorry Vilmar.
    > > > >
    > > > > I guess if the var is stored as a REG_SZ, you'd have to type the

    > literal
    > > > > path.
    > > > >
    > > > > Ray at work
    > > > >
    > > > > "Aaron Bertrand [MVP]" <> wrote in message
    > > > > news:...
    > > > > > 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:%...
    > > > > > > %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" <> wrote in

    > > message
    > > > > > > news:...
    > > > > > > > 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
    > > > > > > >
    > > > > > > >
    > > > > > >
    > > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Ray at, Mar 4, 2004
    #8
  9. > But nothing is running well!

    > BUT the comand COMSPEC disapeared


    What does "running well" mean? What does "disappeared" mean? Maybe you
    could show the actual error message you are receiving. I am betting it's a
    permissions issue... did you recently make any changes to IUSR on this
    machine, or change anonymous to Windows auth or vice versa, or perhaps make
    the site or application run in its own memory space? The user ASP is
    running as needs elevated privileges in order to run a command like cmd.exe
    ....

    (Also, please trim, trim, trim. We don't need to see your original post 20
    times in the thread.)

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/
    Aaron Bertrand [MVP], Mar 4, 2004
    #9
  10. Re: objWshell.Run "%COMSPEC% /C ren topoX.jpg topo_cliente.jpg", 0, TRUE ??? »»»NOW IS OK!!!

    HI people,
    »»»NOW IS OK!!!
    I really had forgot the PATH. See now the correct code that can runs even
    without %COMSPEC% appear in my system variables of my ms-windows operating
    system:
    objWshell.Run "c:\winnt\system32\cmd.exe /C ren
    d:\testes_apostilas\topoX.jpg topo_cliente.jpg", 0, TRUE

    Thanks to everybody.
    --

    Sem mais,

    ««««««««»»»»»»»»»»»»»»
    Vlmar Brazão de Oliveira
    Desenvolvimento Web
    HI-TEC
    Vilmar Brazão de Oliveira, Mar 4, 2004
    #10
  11. Vilmar Brazão de Oliveira

    Phill. W Guest

    "Vilmar Brazão de Oliveira" <> wrote in message
    news:...

    I /almost/ hate to do this, but ... yes; I'm in an ASP group, so ...

    Vilmar,

    Have you come across FileSystemObject?
    For renaming files, it may work rather better that WShell...

    <%
    Dim oFSO
    Set oFSO = CreateObject( "Scripting.FileSystemObject" )

    Call oFSO.MoveFile( "<path>\topoX.jpg", "<path>\topo_cliente.jpg" )

    %>

    HTH,
    Phill W.
    Phill. W, Mar 5, 2004
    #11
  12. thank by the new tip, but I still prefer WSH. it is better for us have all
    control of o.s. shell!
    best regards,
    --

    ««««««««»»»»»»»»»»»»»»
    Vlmar Brazão de Oliveira
    Desenvolvimento Web
    HI-TEC
    "Phill. W" <P.A.Ward@o-p-e-n-.-a-c-.-u-k> escreveu na mensagem
    news:c2a2ks$a1h$...
    > "Vilmar Brazão de Oliveira" <> wrote in message
    > news:...
    >
    > I /almost/ hate to do this, but ... yes; I'm in an ASP group, so ...
    >
    > Vilmar,
    >
    > Have you come across FileSystemObject?
    > For renaming files, it may work rather better that WShell...
    >
    > <%
    > Dim oFSO
    > Set oFSO = CreateObject( "Scripting.FileSystemObject" )
    >
    > Call oFSO.MoveFile( "<path>\topoX.jpg", "<path>\topo_cliente.jpg" )
    >
    > %>
    >
    > HTH,
    > Phill W.
    >
    >
    Vilmar Brazão de Oliveira, Mar 5, 2004
    #12
  13. > thank by the new tip, but I still prefer WSH. it is better for us have all
    > control of o.s. shell!


    No, it's not, IMHO. Why does a web app need "all control of o.s. shell"?

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/
    Aaron Bertrand [MVP], Mar 5, 2004
    #13
  14. Vilmar Brazão de Oliveira

    Ray at Guest

    I'm often more in favor of executing shell commands when I can too, since it
    often simplifies code and is a bit more efficient. <-- That is an assumption
    I've made.

    Ray at work

    "Aaron Bertrand [MVP]" <> wrote in message
    news:...
    > > thank by the new tip, but I still prefer WSH. it is better for us have

    all
    > > control of o.s. shell!

    >
    > No, it's not, IMHO. Why does a web app need "all control of o.s. shell"?
    >
    > --
    > Aaron Bertrand
    > SQL Server MVP
    > http://www.aspfaq.com/
    >
    >
    Ray at, Mar 5, 2004
    #14
  15. > often simplifies code

    In the case of filesystemObject, I disagree. To each his own, I suppose.

    > and is a bit more efficient.


    That's a rather bold assumption. :)

    --
    Aaron Bertrand
    SQL Server MVP
    http://www.aspfaq.com/
    Aaron Bertrand [MVP], Mar 5, 2004
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Siemel Naran

    Does true ^ true return false?

    Siemel Naran, Jun 17, 2004, in forum: C++
    Replies:
    19
    Views:
    652
    Chris Theis
    Jun 18, 2004
  2. Chip
    Replies:
    6
    Views:
    2,619
    E. Robert Tisdale
    Jan 8, 2005
  3. Andy Leszczynski
    Replies:
    4
    Views:
    318
    Erik Max Francis
    Oct 13, 2005
  4. bdb112
    Replies:
    45
    Views:
    1,321
    jazbees
    Apr 29, 2009
  5. news.microsoft.com

    objWshell.run "%COMSPEC% /C d:\rd teste", 0, TRUE ????

    news.microsoft.com, Dec 9, 2003, in forum: ASP General
    Replies:
    3
    Views:
    264
    news.microsoft.com
    Dec 9, 2003
Loading...

Share This Page