469,306 Members | 1,903 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,306 developers. It's quick & easy.

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

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
Jul 19 '05 #1
14 6419
%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" <te***@teste.teste.teste> wrote in message
news:u2*************@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

Jul 19 '05 #2
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:%2****************@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" <te***@teste.teste.teste> wrote in message
news:u2*************@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


Jul 19 '05 #3
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]" <aa***@TRASHaspfaq.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
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:%2****************@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" <te***@teste.teste.teste> wrote in message
news:u2*************@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



Jul 19 '05 #4
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:ek**************@TK2MSFTNGP11.phx.gbl...
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]" <aa***@TRASHaspfaq.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
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:%2****************@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" <te***@teste.teste.teste> wrote in message
news:u2*************@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
>
>



Jul 19 '05 #5
Did you read anything in my first post about checking your environment
variables?

Ray at work

"Vilmar Brazão de Oliveira" <te***@teste.teste.teste> wrote in message
news:el**************@TK2MSFTNGP10.phx.gbl...
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:ek**************@TK2MSFTNGP11.phx.gbl...
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]" <aa***@TRASHaspfaq.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
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:%2****************@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" <te***@teste.teste.teste> wrote in message > news:u2*************@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
> >
> >
>
>



Jul 19 '05 #6
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#**************@tk2msftngp13.phx.gbl...
Did you read anything in my first post about checking your environment
variables?

Ray at work

"Vilmar Brazão de Oliveira" <te***@teste.teste.teste> wrote in message
news:el**************@TK2MSFTNGP10.phx.gbl...
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:ek**************@TK2MSFTNGP11.phx.gbl...
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]" <aa***@TRASHaspfaq.com> wrote in message
news:e2**************@TK2MSFTNGP10.phx.gbl...
> 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:%2****************@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" <te***@teste.teste.teste> wrote in message > > news:u2*************@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
> > >
> > >
> >
> >
>
>



Jul 19 '05 #7
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" <te***@teste.teste.teste> wrote in message
news:ug**************@tk2msftngp13.phx.gbl...
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#**************@tk2msftngp13.phx.gbl...
Did you read anything in my first post about checking your environment
variables?

Ray at work

"Vilmar Brazão de Oliveira" <te***@teste.teste.teste> wrote in message
news:el**************@TK2MSFTNGP10.phx.gbl...
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:ek**************@TK2MSFTNGP11.phx.gbl...
> 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]" <aa***@TRASHaspfaq.com> wrote in message
> news:e2**************@TK2MSFTNGP10.phx.gbl...
> > 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:%2****************@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" <te***@teste.teste.teste> wrote in

message
> > > news:u2*************@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
> > > >
> > > >
> > >
> > >
> >
> >
>
>



Jul 19 '05 #8
> 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/
Jul 19 '05 #9
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
Jul 19 '05 #10
"Vilmar Brazão de Oliveira" <te***@teste.teste.teste> wrote in message
news:u2*************@TK2MSFTNGP12.phx.gbl...

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.
Jul 19 '05 #11
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:c2**********@yarrow.open.ac.uk...
"Vilmar Brazão de Oliveira" <te***@teste.teste.teste> wrote in message
news:u2*************@TK2MSFTNGP12.phx.gbl...

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.

Jul 19 '05 #12
> 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/
Jul 19 '05 #13
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]" <aa***@TRASHaspfaq.com> wrote in message
news:OP*************@TK2MSFTNGP09.phx.gbl...
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/

Jul 19 '05 #14
> 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/
Jul 19 '05 #15

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Udo Pecher | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.