PC Review


Reply
Thread Tools Rate Thread

Use a startup script to call a local scrip to execute.....

 
 
Momo
Guest
Posts: n/a
 
      24th Mar 2005
We've encountered a strange problem lately in devloping a vbs script
which writes a text file and an event log to a server. We have this
script run via GPO on computer startup.

What we've found is that if the computer is in a subnet diff than the
server the script cannot write the text file or event logs.
Also if we put the script on a network share on a diff subnet it also
cannot right to the server. It only works is a. if the computer and
server are on the same subnet or b. the script is executed locally on
the computer.

What we've deceided to do is have a GPO startup vbs script that copies
the vbs scipt to each computers c:\temp than run it from there.

But what I'm not sure of is how to write the startup script so that it
calls the vbs script thats been copies to c:\temp so that it'll execute
the script in the context of the local computer.

I've tried using a batch fille ie.

copy script.vbs c:\temp
wscript script.vbs


but this did'nt seem to work can anyone help PLEaase...........

 
Reply With Quote
 
 
 
 
frank
Guest
Posts: n/a
 
      24th Mar 2005
I recommend using %temp% environment variable rather than hardcoding c:\temp
which may not exist on many machines. So your code would look like:

copy script.vbs %temp%\script.vbs
wscript %temp%\script.vbs

-frank

"Momo" <louey-(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> We've encountered a strange problem lately in devloping a vbs script
> which writes a text file and an event log to a server. We have this
> script run via GPO on computer startup.
>
> What we've found is that if the computer is in a subnet diff than the
> server the script cannot write the text file or event logs.
> Also if we put the script on a network share on a diff subnet it also
> cannot right to the server. It only works is a. if the computer and
> server are on the same subnet or b. the script is executed locally on
> the computer.
>
> What we've deceided to do is have a GPO startup vbs script that copies
> the vbs scipt to each computers c:\temp than run it from there.
>
> But what I'm not sure of is how to write the startup script so that it
> calls the vbs script thats been copies to c:\temp so that it'll execute
> the script in the context of the local computer.
>
> I've tried using a batch fille ie.
>
> copy script.vbs c:\temp
> wscript script.vbs
>
>
> but this did'nt seem to work can anyone help PLEaase...........
>



 
Reply With Quote
 
 
 
 
Momo
Guest
Posts: n/a
 
      25th Mar 2005
Thanks for the reply.......

But if I wanted to write it using vbs can you suggest how i can write
it please not really sure........ since never really done vbs
programming....

 
Reply With Quote
 
Andrew Mitchell
Guest
Posts: n/a
 
      25th Mar 2005
"Momo" <louey-(E-Mail Removed)> said

> We've encountered a strange problem lately in devloping a vbs script
> which writes a text file and an event log to a server. We have this
> script run via GPO on computer startup.
>
> What we've found is that if the computer is in a subnet diff than the
> server the script cannot write the text file or event logs.
> Also if we put the script on a network share on a diff subnet it also
> cannot right to the server. It only works is a. if the computer and
> server are on the same subnet or b. the script is executed locally on
> the computer.
>
> What we've deceided to do is have a GPO startup vbs script that copies
> the vbs scipt to each computers c:\temp than run it from there.
>
> But what I'm not sure of is how to write the startup script so that it
> calls the vbs script thats been copies to c:\temp so that it'll execute
> the script in the context of the local computer.
>
> I've tried using a batch fille ie.
>
> copy script.vbs c:\temp
> wscript script.vbs
>
>
> but this did'nt seem to work can anyone help PLEaase...........
>


copy script.vbs %temp%
cscript %temp%\script.vbs


--

Andy.
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Using aspx page like this: <script src="ASPXPageHere.aspx"></scrip Mike Microsoft ASP .NET 2 28th Nov 2007 03:37 PM
A command file/scrip to run in the logoff process =?Utf-8?B?Q0o=?= Windows XP General 1 15th Oct 2004 11:07 PM
scrip error messages ayshe Windows XP Basics 1 18th Sep 2004 04:17 AM
scrip error nana Windows XP Print / Fax 1 3rd Feb 2004 06:28 AM
java scrip vee thomas Windows XP General 1 15th Oct 2003 07:02 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:15 AM.