|
| |||||||||
| Tags: bat files, create bat, insert lines, vb script, vbs |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Create .bat and insert lines from .vbs
I need to create a .bat file from a VB script. It also needs to copy some lines into the new batch file. Example: If value = something1 Then ' create .bat file and insert into batch file: Sh.Run("%systemdrive%\Software\McAfee\EPO\FramePkg.exe"), 0, True If value = something2 Then ' create .bat file and insert into batch file: Sh.Run("%systemdrive%\Software\McAfee\Standalone\Install.bat"), 0, True End if Thanks! |
|
#2
| ||||
| ||||
| Re: Create .bat and insert lines from .vbs
Creating a batch file very simple. You simply type in your code into a notepad file which may include the above lines and instead of saving it as *.txt file, you save it as *.bat. That's it. This is the basic logic. So you generate the code which will copy your code in the a file and save it as .bat file. Its very time consuming to give you the complete code and so I just gave you the logic.
__________________ The FIFA Manager 2009 PC Game |
|
#3
| |||
| |||
| Create .bat and insert lines from .vbs
I think, you need to view this and from here you can find the best one according to your suggested issues...you need to follow some instructions and if you are getting any issues then feel free to post me... 1) Create .bat from .vbs: . 2) Append to .bat from .vbs Code: textfilemodes used by filesystemobject:
const forreading=1
const forwriting=2
const forappending=8
example append:
set bat=opentextfile("existing.bat",8)
bat.writeline "appended line here"
bat.close |
|
#4
| |||
| |||
| Re: Create .bat and insert lines from .vbs
opaper - please read the post. It says create .bat FROM a .vbs. Katty - Thanks. I found out how to do it and it works great. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Create .bat and insert lines from .vbs" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Why are T1 lines so expensive? | Shakaal | Networking & Security | 4 | 16-09-2010 01:18 PM |
| Don't know how to insert or create AutoText in Microsoft Word | Khan Baba | Windows Software | 5 | 22-01-2010 12:41 PM |
| How to insert random lines | MADGE25 | Software Development | 4 | 25-11-2009 05:16 PM |
| How to use sed to insert lines in a file | McGrawh | Software Development | 2 | 25-06-2009 12:45 AM |
| How do I create a textbox in vb that lets you insert tabs? | Chandrakant81 | Software Development | 3 | 26-02-2009 09:59 PM |