Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


RE: Calling a Script

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,43621
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: Calling a Script
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: <<   < prev  1 [2]
Login
Message << Older Topic   Newer Topic >>
 RE: Calling a Script - 2/26/2007 5:43:24 AM   
  ehvbs

 

Posts: 2077
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi morpheus83uk,

(1) if your code still looks like

       Set objFSO = CreateObject("Scripting.FileSystemObject")
       Set objFile = objFSO.CreateTextFile("C:\Maintenance_Log.txt")
       Set objfile = Nothing
       Set objFile = objFSO.OpenTextFile("C:\Maintenance_Log.txt", ForAppending, True)
       WScript.Sleep 40000
   
     try:

       Set objFile = objFSO.CreateTextFile("C:\Maintenance_Log.txt")
       objFile.Close
       Set objfile = Nothing

     or (better, why open it twice?):

       Set objFSO = CreateObject("Scripting.FileSystemObject")
       Set objFile = objFSO.OpenTextFile("C:\Maintenance_Log.txt", ForAppending, True)
       WScript.Sleep 40000

(2) if not, check rights/permissions again

Good luck!

ehvbs

(in reply to morpheus83uk)
 
 
Post #: 21
 
 RE: Calling a Script - 2/28/2007 3:28:59 AM   
  morpheus83uk

 

Posts: 279
Score: 0
Joined: 8/21/2006
Status: offline
Hello,

I have found that when the folder is created it creates it with no permissions to the user the script is being run as... How would I get it to give full permissions to tthe user who is running the script? Or if it is being RUN AS another user it give them full access to the folder and files?

Also though when I manually give permissions to the foler and files I still get the Permission denied error....

Any suggestions?

Many Thanks

James

(in reply to ehvbs)
 
 
Post #: 22
 
 RE: Calling a Script - 3/3/2007 6:54:32 AM   
  morpheus83uk

 

Posts: 279
Score: 0
Joined: 8/21/2006
Status: offline
I think I have cracked my permisions thing...

I have used a batch file to create the directory and then set the permissions on it using the CACLS command... It seems to work in win XP not tested it yet in Windows 2000. Just thought I would let you guys know..

Then the next thing is error reporting which should be fun..

Many Thanks for your help I have learned alot.

James

(in reply to morpheus83uk)
 
 
Post #: 23
 
 RE: Calling a Script - 3/4/2007 6:54:13 AM   
  morpheus83uk

 

Posts: 279
Score: 0
Joined: 8/21/2006
Status: offline
Hello,

I have got my script to run with no errors it goes through fine. However when I run the script a second time it gives me a Permission denied error part way through the script when it calls the disableSystemrestore.VBS and tried to write to the file it denies access and does the same for the scripts below it. Only on the disablesystemrestore.vbs does this happen and the below scripts however the scripts which run above it work fine and there is no diffrence in the coding...  I know I have permission as the first part of the script gives permission plus the fact that if teh script has been run once then the permissions should already be set.

Does anyone have any ideas on why this would happen?


Many Thanks

James

(in reply to morpheus83uk)
 
 
Post #: 24
 
 
Page:  <<   < prev  1 [2]
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> RE: Calling a Script Page: <<   < prev  1 [2]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts