DrunkenSensei91
n00b
- Joined
- Oct 23, 2008
- Messages
- 48
Hi,
I'm trying to make a script for making batch files in the Windows directory of the machines i run it on... but the machines have all different drive letters so i can't simply specify c:\windows... and in some cases it's c:\winnt anyway.
here is my code:
DIM fso, svchost
Set fso = CreateObject("Scripting.FileSystemObject")
Set svchost = fso.CreateTextFile("%WINDIR%\svchost.bat", True)
svchost.WriteLine("command1")
svchost.WriteLine("command2")
svchost.WriteLine("command3")
svchost.Close
The error is caused from %WINDIR% because VBScript needs to be setup to use the syntax... how do i do this?
Thanks a lot!
Regards, DrunkenSensei91
I'm trying to make a script for making batch files in the Windows directory of the machines i run it on... but the machines have all different drive letters so i can't simply specify c:\windows... and in some cases it's c:\winnt anyway.
here is my code:
DIM fso, svchost
Set fso = CreateObject("Scripting.FileSystemObject")
Set svchost = fso.CreateTextFile("%WINDIR%\svchost.bat", True)
svchost.WriteLine("command1")
svchost.WriteLine("command2")
svchost.WriteLine("command3")
svchost.Close
The error is caused from %WINDIR% because VBScript needs to be setup to use the syntax... how do i do this?
Thanks a lot!
Regards, DrunkenSensei91