|
| ||||||||||
| Tags: vb script, visual basic |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| VB script or code to open copy and paste in file
|
|
#2
| |||
| |||
| Re: VB script or code to open copy and paste in file
Depends on what format of files you are trying to involve in the task. I mean to say that if you are trying to perform the manipulation of the data of a complex then it would have been quite impossible but if you are involving a text file rather than any other file then I must say you can easily achieve your target. Anyways if in case you are really trying your hands with text file then the only thing I would suggest you is to start with filesystemobject. This filesystemobject search only work with text files. Another thing I would like to tell you that copy a data or a program in order to transfer them from one file to another would be much easier with a Copy Program only if you need your script to be able to call other programs. |
|
#3
| ||||
| ||||
| Re: VB script or code to open copy and paste in file
In a simple language the above person means to say that in such programs the codes are written on the basis of the file format. Copy Program is a good option I must say. This program is something that will have to undertake within the batch file or a command line for copying the file. The syntax you could use is Copy Source Destination. Using a VB Script code you can do it in the following manner: set WSshell = createobject("wscript.shell") WSshell.run("copy c:\foldername\filename.txt c:\folder2name\file2name.txt",1) Just try this out and let me know the result. |
|
#4
| |||
| |||
| Re: VB script or code to open copy and paste in file
Using a Shell initially game me some errors. Obviously the errors are not at all understandable by me. The error message also produces some error code. I have tried running the following code: Shell "notepad.exe c:\foldername\filename.txt", vbMaximizedFocus Later on found that I followed the code wrongly. Actually the syntax belonged to Visual Basic Application. Then however after a long research I got the correct code for VB script. It was as follows: set WSshell = createobject("wscript.shell") WSshell.run("notepad.exe c:\foldername\filename.txt", 1) |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "VB script or code to open copy and paste in file" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to copy paste file in Micromax Funbook | Ogan | Portable Devices | 3 | 12-07-2012 06:13 PM |
| I cannot do Copy and Paste or Paste Special between Excel Workbooks | Acca-OR | Windows Software | 5 | 26-04-2012 04:16 AM |
| Excel file corrupted because of copy paste between files | RopeME | MS Office Support | 2 | 25-01-2012 03:52 PM |
| How to bypass the open file security warning in vb script | Quasim | Software Development | 5 | 05-07-2011 07:27 PM |
| Copy Text from One Cell to Another in Microsoft Excel without copy & paste | Computer_Freak | Tips & Tweaks | 0 | 18-03-2009 10:00 PM |