From: Kenneth A. Larsen on

"Saucer Man" <saucerman(a)nospam.com> wrote in message
news:4c33499e$0$2407$cc2e38e6(a)news.uslec.net...
>> The lines you quote after "writelog" are fine but none of them will alter
>> the behaviour of your script in any way. You could omit the whole lot.
>> After the interpreter has executed the WriteLog subroutine it will
>> disassociate the various variables from their objects and terminate the
>> script, even without the "nothing" and "quit" keywords. The problem
>> therefire lies in your WriteLog subroutine. What does it look like?
>
> Thank you both for your input. The script I am using is this one...
>
> http://www.anonymoos.com/scripting/logonscript.txt

You are welcome for the input.
>
>


From: Kenneth A. Larsen on

"Pegasus [MVP]" <news(a)microsoft.com> wrote in message
news:OIDcSnRHLHA.4120(a)TK2MSFTNGP02.phx.gbl...
>
>
> "Saucer Man" <saucerman(a)nospam.com> wrote in message
> news:4c333e54$0$2394$cc2e38e6(a)news.uslec.net...
>> I have a .vbs script that maps drives and network printers. The script
>> lives on the network. I script is not quitting on Windows 7. It works
>> fine on XP and Vista. I can tell this because it writes a log file to
>> the root of C:/. After it has run, I try to modify the log file and save
>> it but I get an access denied error.
>>
>> The last lines of the script are...
>>
>> writelog "################ End Login Script ###################"
>>
>> Set objNetwork = Nothing
>> Set objDrives = Nothing
>> Set objComputer = Nothing
>> Set objShell = Nothing
>> Set objFileSystem = Nothing
>> Set objLogFile = Nothing
>> 'Msgbox "Logon Script Complete",,"Mapper"
>> WScript.Quit
>>
>> --
>> Thanks!
>
> The lines you quote after "writelog" are fine but none of them will alter
> the behaviour of your script in any way. You could omit the whole lot.
> After the interpreter has executed the WriteLog subroutine it will
> disassociate the various variables from their objects and terminate the
> script, even without the "nothing" and "quit" keywords. The problem
> therefire lies in your WriteLog subroutine. What does it look like?

You're welcome!


From: Kenneth A. Larsen on

"Saucer Man" <saucerman(a)nospam.com> wrote in message
news:4c34cd29$0$2403$cc2e38e6(a)news.uslec.net...
>
> "Tom Lavedas" <tglbatch(a)verizon.net> wrote in message
> news:bd2c8f61-01d5-4e25-b12b-ad79c2217d02(a)w12g2000yqj.googlegroups.com...
>
> OK. That says the final write is performed, which leaves my initial
> guess as the next most likely thing to try. That is, ...
>
> writelog "################ End Login Script ###################"
>
> Set objNetwork = Nothing
> Set objDrives = Nothing
> Set objComputer = Nothing
> Set objShell = Nothing
> Set objFileSystem = Nothing
> ' Added line of code
> objLogFile.close
> '
> Set objLogFile = Nothing
> 'Msgbox "Logon Script Complete",,"Mapper"
> WScript.Quit
>
> I don't know why the CLOSE would be needed, but it can't hurt and just
> maybe ...
> _____________________
> Tom Lavedas
>
>
>
> I added the above line but it didn't help. Then it occured to me that it
> is probably Windows 7 saying "access denied" because of UAC..not because
> the script was not quitting. I opened Notepad as Administrator and then I
> was able to make changes to the log and save it without a problem.
>
> Thank you both for all your help and efforts!

You are welcome for all help and efforts.
>
>