CScript execution privileges on WinNT4.0 
Author Message
 CScript execution privileges on WinNT4.0

Hi,

I have a Jscript script file that I run using cscript at a DOS prompt in
WinNt4.0. The script creates a directory at runtime. This directory is
used to store log files generated by a program that the script starts.
However, the program fails because it cannot save files in the directory
that has been created.

On further investigation, I discovered that the permissions on the
generated directory were insufficient for the called program to create
files in it. What I want to know is:
    What privileges is cscript being run under?
    How do they affect the permissions attached to folders/files created
by a script?
    How can I change those privileges to allow me to create files in my
generated directory?

Any help would be much appreciated.



Tue, 17 Sep 2002 03:00:00 GMT  
 CScript execution privileges on WinNT4.0
Here are some excellent resources for how to use an impersonation level with the Windows Management Interface(WMI)

Win32 Scripting
http://cwashington.netreach.net
http://cwashington.netreach.net/script_repository/query.asp
http://cwashington.netreach.net/main_site/downloads
http://cwashington.netreach.net/script_repository/faqs.asp?topic=wmifaq
http://cwashington.netreach.net/script_repository/faqs.asp?topic=adsifaq

WSHFAQ

http://www.windows-script.com/

--
Mark L. Ferguson       Please reply in Newsgroup
marfers notes for OE 5.0  >  http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm

Quote:

> Hi,

> I have a Jscript script file that I run using cscript at a DOS prompt in
> WinNt4.0. The script creates a directory at runtime. This directory is
> used to store log files generated by a program that the script starts.
> However, the program fails because it cannot save files in the directory
> that has been created.

> On further investigation, I discovered that the permissions on the
> generated directory were insufficient for the called program to create
> files in it. What I want to know is:
>     What privileges is cscript being run under?
>     How do they affect the permissions attached to folders/files created
> by a script?
>     How can I change those privileges to allow me to create files in my
> generated directory?

> Any help would be much appreciated.



Tue, 17 Sep 2002 03:00:00 GMT  
 CScript execution privileges on WinNT4.0
CScript and WScript both run in the same security context of whatever starts them.  It doesn't
change the security context in any way.  Scripts executed by an interactive user can do whatever
that user's security credentials allow.  Scripts executed by any sort of scheduling tool (the AT
command, Scheduled Tasks, Norton Scheduler, etc.) run either under a fixed account (e.g., At command
and Norton's scheduler are like this, using the local SYSTEM account by default) but Schedule Tasks
lets you configure each task with different credentials.  AFAIK, under NT, newly created
folders/files inherit the ACLs of the parent folder.  The script hosts themselves don't have any
effect on that.

--
Michael Harris
MVP Scripting

Hi,

I have a Jscript script file that I run using cscript at a DOS prompt in
WinNt4.0. The script creates a directory at runtime. This directory is
used to store log files generated by a program that the script starts.
However, the program fails because it cannot save files in the directory
that has been created.

On further investigation, I discovered that the permissions on the
generated directory were insufficient for the called program to create
files in it. What I want to know is:
    What privileges is cscript being run under?
    How do they affect the permissions attached to folders/files created
by a script?
    How can I change those privileges to allow me to create files in my
generated directory?

Any help would be much appreciated.



Tue, 17 Sep 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help please: using TrueType + ps2pdf (GS6.50) + WinNT4

2. Error in WINNT4.0 but not in W2K

3. WSH Installation error WinNT4.0 SP4

4. ? about WinNT4.0 and W2K

5. connecting to w2k printer share via winnt4 fails

6. Checking current user privileges

7. To check Administrative Privilege or not

8. Running a script with administrator privileges

9. Determining Network share privileges

10. Allowing user network privileges...

11. How to allow non privileged user to control a service w/wsh

12. Sfimpersonator.dll - required privilege

 

 
Powered by phpBB® Forum Software