473,405 Members | 2,171 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

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 6621
%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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Udo Pecher | last post by:
I apply the following code test.php $upload =ftp_put($conn_id,"test.jpg","$dat",FTP-BINARY); where $dat is a local filename which I like to move via FTP. "test.jpg" ist the filename on the...
3
by: news.microsoft.com | last post by:
Hi folks, I got samples on http://www.aspfaq.com/show.asp?id=2059 and runs ok to dir ms-dos command, but to others commands like del, rd, deltree, etc... it has not had any effect, even it has...
10
by: Vilmar Brazão de Oliveira | last post by:
HI people, what is wrong in the code bellow to kill iexplore.exe process after processing my page?? '»»Before comes routines to access data base and to send email. Set objWshell =...
9
by: Don | last post by:
Does anyone know where I can find a client-side function I can reference from within an HTML/JavaScript web page? I'm currently using a core PHP function to do this, but I'd rather do it on the...
5
by: mr_cross | last post by:
Hi. It's been a very long time since I did any extensive html coding, so all I recall are the basics. I'm looking to create a web site with a lot of jpg pictures divided among several web pages. Is...
5
by: Fabrizio | last post by:
My web cam save a file each minute with a name like this "history20070611s202635195.jpg" Do you know a script that can animate the last 60 jpg ? What I like is something like this: ...
2
by: defn noob | last post by:
from Tkinter import * import os master = Tk() w = Canvas(master, width=800, height=600) print os.path.exists('C:/me/saftarn/desktop/images/blob4.jpg') im = PhotoImage(file =...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.