1.

Solve : cmd.exe in limiter user?

Answer»

Hi,
I have a problem using cmd.exe as a limited user runnig a batch file.

I have a small .com program called REPLY.com, when executed in a batch file, it waits for the user to press a key and reply.com returns the key pressed as an errorlevel. This works fine when I log in as the admin. If I log is as a limited user, the batch file continues past the reply.com with an error:

"C:\WINDOWS\system32\cmd.exe
C:\Ducume~1\Frank\Locals!~1\Temp. A temporary file needed for initialization could not be created or could not be written to. Make sure that the directory path exists, and disk space is available. CHOOSE 'Close' to terminate the application."

That folder is accessible, I have plenty of disk space, so I don't understand what it wants to do that it cannot do.
Does anyone have an idea?
Thanks
Franklog in as admin and change permissions for command.comI have changed permissions for cmd.exe to have full access by by the limited user.
No change.
I changed permissions on command.com as suggested also.
No change.
FrankThis may be a long shot, but maybe ... the temp file was created on a prior use of the reply program and was not deleted for unknown reasons. If it was marked read only, or if it was still in use, then you would likely get that error. Not all programs handle their temp files as well as they should. When I look at my temp folder, I usually find a lot of stranded temp files.

Try deleting all of your temp files and see if any are left. Reboot to safe mode, or as admin, and delete the remaining ones if possible. Then try your reply.com program again with the temp folder open to see what file(s) if any are created, and whether or not they are deleted properly after reply closes.

You could also log in as admin. & watch the admin temp folder while running the program for the same thing. This may be a long shot, but it may give you a clue or two, by knowing which temp files are being created and whether or not they are being deleted properly.

What version of windows do you have? I am not familiar with the C:\Ducuments folder structure. "C:\Ducume~1\Frank\Locals!~1\Temp". (Sorry, I couldn't resist, but seriously, what windows version are you running?)

Quote from: Frank on June 08, 2008, 05:34:36 AM

If I log is as a limited user, the batch file continues past the reply.com with an error:

I'm not sure exactly what you mean by "the batch file continues past the reply.com " Please show us the command line you are using to start reply.com. It may be that we can TWEAK that line a bit.

Is reply.com a freeware, or shareware program? If so please list the link, (or the program) so we can have a look.

Can you explain the errorlevel scheme? It may be possible that someone here could DUPLICATE the program's functions without the need of the additional program.


Quote from: llmeyer1000 on June 08, 2008, 08:04:10 PM
I am not familiar with the C:\Ducuments folder structure. "C:\Ducume~1\Frank\Locals!~1\Temp".

Me neither. If it quacks like a duc..I run Windows XP SP2.
I deleted all files from the that temp folder.
I don't think we need to go into the batch file itself yet because I found another major problem showing the same error.
If I try to just launch command.com (not cmd.exe) as a limited user from the start\run but it fails to complete the launch and gives the same error message as before. No batch file being launched yet. While the error window is shown, the temp folder is still empty. I would like to paste the picture of the window here (but don't know how to).
Frank

PS. Just noticed trying to launch edit.com causes the same error.Frank,
I just googled your error:
A temporary file needed for initialization could not be created or could not be written to.
(I've never included that many search words before!) and WOW! You are not the first to have this problem. It appears that your temp folder may be marked read only and according to others who have experienced this problem, you will not be able to remove the attributes from the folder. (at least without some good old registry editing.) Some of the threads I found point you to a couple of microsoft sites, so the information is probably good. I didn't read through it all, so I suggest that you do some diligent research yourself, before making any of the changes suggested.

Do the google search and read up, before proceeding. Here are a few links that SEEMED appropriate: (Remember, I have NOT had this problem and cannot guarantee any favorable results. Be careful!)
http://www.pcreview.co.uk/forums/thread-94210.php
http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q256614
http://support.microsoft.com/?kbid=326549
llmeyer1000, I did what those websites suggested. No change. It looks like I cannot launch any .com program.

I tried the Guest account - the same.
I created a new limited user account - the same.

I think the problem is deep inside Windows and I think it's broken.
A few weeks ago I had a major virus attack - a rootkit. I had to get rid of it because when I restored a full backup of drive C:, the virus was still there. I found it, removed it with ComboBox. Then restored the full backup again. It all appeared to work. Since I always worked on the machine as an Admin user, I now decided to create a limited user to run the machine to increase security regarding future viruses. Unfortunately, I now have this problem.
Maybe my only solution is going to do a fresh install of Windows and start again. What do you think?
FrankA clean install is always good!, but it does take some time. And you have to remember to backup everything! It is so easy to lose data that you forgot about. If you can't fix it, I don't see where you have a whole lot of choice.

Is there more than one partition on the HD? If not, it wouldn't hurt to also wipe the first part of you drive, to make sure that no corrupted data is carried forword.The only reason for doing a clean new install, in my case, is because I am unable to get the batch file to work properly. If I could replace a couple of 16 bit .com applications with 32 bit apps, my batch file would work. I would not require to run any other 16 bit apps.
This is batch file (menu.bat). It is copied as a skeleton from a book called Supercharging MS-Dos published in 1986:

@echo off
echo {ESC}[m
prompt
:START
cls
rem menu\nocurs.com
%dr%
type menu\menu1.txt
echo Press the required function key on the keyboard:
:GET_REPLY
menu\reply.com
rem echo got here
if errorlevel 69 goto GET_REPLY
if errorlevel 68 goto F10
if errorlevel 67 goto F9
if errorlevel 66 goto F8
if errorlevel 65 goto F7
if errorlevel 64 goto F6
if errorlevel 63 goto F5
if errorlevel 62 goto F4
if errorlevel 61 goto F3
if errorlevel 60 goto F2
if errorlevel 59 goto F1
goto GET_REPLY
:F10
cls
goto :END
:F9
cls
goto START
:F8
cls
goto START
:F7
cls
goto START
:F6
cls
goto START
:F5
cls
goto START
:F4
cls
goto START
:F3
cls
goto START
:F2
echo F2
explorer.exe
goto START
:F1
echo F1
cmd.exe
goto START
:END
%dr%
remmenu\normcurs.com
rem promptrs
exit

There are 3 .com files. These were created by dos debug by scripts.
reply.com by reply.scr
debug < reply.scr
a 100
mov ah,8
int 21
cmp al,0
jnz 10a
int 21
mov ah,4c
int 21

r cx
e
n reply.com
w
q

nocurs.com by nocurs.scr
debug < nocurs.scr
a 100
mov ah,1
mov ch,20
int 10
int 20

r cx
8
n nocurs.com
w
q


And nocurs.com by nocurs.scr
debug < nocurs.scr
a 100
mov ah,0f
int 10
cmp al,7
jz 10d
mov cx,607
jmp 110
mov cx,0b0c
mov ah,1
int 10
int 20

r cx
16
n normcurs.com
w
q

The nocurs.com does not work running cmd.exe. It does work on the other machine using command.com in dosonly in the config.nt. The reply.com I think I found a solution to the batch file problem.
Found a fine called choice.exe (choice.com doesn't work for the same reason that the other .com programs don't).

I need to change the batch file a little around the if errorlevel lines since choice.exe returns with different codes.

One of the command line switches for choice.exe is the /c:?. Where the ? are keys that choice.exe will accept. What do I enter for keys like F1 or F2?
Thanks
FrankChoice does not work with the function keys F1 to F12.
Thank you very much.
I will just have to use the 0-9 keys

About not being able to run .com files, I might ask the Windows Forum.
Frank


Discussion

No Comment Found