Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > objWshell.Run "%COMSPEC% /C ren topoX.jpg topo_cliente.jpg", 0, TRUE ???

Reply
Thread Tools

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

 
 
Vilmar Brazão de Oliveira
Guest
Posts: n/a
 
      03-04-2004
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


 
Reply With Quote
 
 
 
 
Ray at
Guest
Posts: n/a
 
      03-04-2004
%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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
 
Aaron Bertrand [MVP]
Guest
Posts: n/a
 
      03-04-2004
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:%(E-Mail Removed)...
> %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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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
> >
> >

>
>



 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      03-04-2004
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]" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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:%(E-Mail Removed)...
> > %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" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Vilmar Brazão de Oliveira
Guest
Posts: n/a
 
      03-04-2004
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:(E-Mail Removed)...
> 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]" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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:%(E-Mail Removed)...
> > > %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" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > 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
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      03-04-2004
Did you read anything in my first post about checking your environment
variables?

Ray at work

"Vilmar Brazão de Oliveira" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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:(E-Mail Removed)...
> > 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]" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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:%(E-Mail Removed)...
> > > > %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" <(E-Mail Removed)> wrote in

message
> > > > news:(E-Mail Removed)...
> > > > > 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
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Vilmar Brazão de Oliveira
Guest
Posts: n/a
 
      03-04-2004
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#(E-Mail Removed)...
> Did you read anything in my first post about checking your environment
> variables?
>
> Ray at work
>
> "Vilmar Brazão de Oliveira" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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:(E-Mail Removed)...
> > > 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]" <(E-Mail Removed)> wrote in message
> > > news:(E-Mail Removed)...
> > > > 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:%(E-Mail Removed)...
> > > > > %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" <(E-Mail Removed)> wrote in

> message
> > > > > news:(E-Mail Removed)...
> > > > > > 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
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      03-04-2004
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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#(E-Mail Removed)...
> > Did you read anything in my first post about checking your environment
> > variables?
> >
> > Ray at work
> >
> > "Vilmar Brazão de Oliveira" <(E-Mail Removed)> wrote in message
> > news:(E-Mail Removed)...
> > > 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:(E-Mail Removed)...
> > > > 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]" <(E-Mail Removed)> wrote in message
> > > > news:(E-Mail Removed)...
> > > > > 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:%(E-Mail Removed)...
> > > > > > %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" <(E-Mail Removed)> wrote in

> > message
> > > > > > news:(E-Mail Removed)...
> > > > > > > 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
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >

> >
> >

>
>



 
Reply With Quote
 
Aaron Bertrand [MVP]
Guest
Posts: n/a
 
      03-04-2004
> 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/


 
Reply With Quote
 
Vilmar Brazão de Oliveira
Guest
Posts: n/a
 
      03-04-2004
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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[False,True] and [True,True] --> [True, True]????? bdb112 Python 45 04-29-2009 02:35 AM
ATAs and REN Mark UK VOIP 5 07-22-2005 10:23 AM
Ren & Stimpy? Aphelion DVD Video 18 06-22-2004 02:12 PM
objWshell.run "%COMSPEC% /C d:\rd teste", 0, TRUE ???? news.microsoft.com ASP General 3 12-09-2003 07:49 PM
Ren and Stimpy Time/Life release? Jordan Lund DVD Video 4 09-20-2003 03:28 PM



Advertisments