|
Answer» hi, this script makes an map on the c:/ drive with as name your bios DATE. That script worked in .bat extention. But i wanted to compile it to exe (with quick batch FILE compiler), the compiling worked, but when i tried to open it, i got errors (here is the script) can sombody help me?
[script] @echo off >>%temp%/bios.vbs ECHO On ERROR Resume Next >>%temp%/bios.vbs ECHO Const wbemFlagReturnImmediately = ^&^h10 >>%temp%/bios.vbs ECHO Const wbemFlagForwardOnly = ^&^h20 >>%temp%/bios.vbs ECHO Set fso = CreateObject("Scripting.FileSystemObject") >>%temp%/bios.vbs ECHO strComputer = "." >>%temp%/bios.vbs ECHO Set objWMIService = GetObject("winmgmts:\\" ^&^ strComputer ^&^ "\root\CIMV2") >>%temp%/bios.vbs ECHO Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ >>%temp%/bios.vbs ECHO wbemFlagReturnImmediately + wbemFlagForwardOnly) >>%temp%/bios.vbs ECHO For Each objItem In colItems >>%temp%/bios.vbs ECHO fso.CreateFolder("c:\" ^&^ WMIDateString(objItem.ReleaseDate)) >>%temp%/bios.vbs ECHO Next >>%temp%/bios.vbs ECHO Function WMIDateString(dtmDate) >>%temp%/bios.vbs ECHO WMIDateString = Mid(dtmDate, 7, 2) ^&^ Mid(dtmDate, 5, 2) ^&^ Left(dtmDate, 4) >>%temp%/bios.vbs ECHO End Function "%temp%/bios.vbs" echo created succesfully pause [/script] As I understand it, you're using a batch file to write a script and now you want to encode the batch file? Why on earth for? Scripts are meant to be read and executed as text files. You would be better off keeping your vbscript as a text file but if absolutely necessary (security reasons I presume) you can get a Script Encoder from Microsoft (free).
The encoder works with script files not batch files.
Good luck.
|