473,320 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Using a simple VB Form to rename files using CMD Prompt (done in Excel - screenshots)

I have a very VERY basic knowledge of VB6, I've been using it for years but following tutorials etc. I'm not stupid but far from knowledgeable.

Here is (hopefully) all you'll need to know what I need help with.

http://i49.tinypic.com/35n6j6f.png
Aug 2 '12 #1
3 2171
On another website I've learned about the Shell() function and VB's native rename file function 'Name OldFileName As NewFileName' so I have more to ask:

What functions are necessary for me to browse for a folder, and then for VB to copy all the filenames to the clipboard (to then paste into the script that'll be executed in the cmd prompt as "ren <orig filename> <new filename>/ as Name <orig filename> As <new>)?
I'm looking for absolute basics so I can go off and google what else I need rather than being given the code, afterall I'm not going to learn getting given the code!

Also, how can I save the final string of text as a batch file? Better yet, is it possible to, instead of exporting and then runnning the batch file, simply executing the dos command inside the executable? From what you've told me, obviously not like this as i'm making t up, would it be as simple as "shell() run <final string of text>"?

Apologies for my lack of knowledge; I've just discovered I'd use Shell() to OPEN the cmd prompt as opposed to the function itself opening the cmd prompt
Aug 2 '12 #2
Killer42
8,435 Expert 8TB
If you have a browse through the "Insights" part of this VB 4/5/6 forum (click the "Insights" tab up top) you'll find various articles on how to read and write files, list the contents of a folder, execute a shell command from VB and similar topics.
Aug 7 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: sifar | last post by:
Hi, I am right now learning PHP & want to know if there is a way to send web form data to an Excel sheet located on a network. My windows xp PC doesnot have a copy of Excel. Also i am not...
16
by: dudufigueiredo | last post by:
I have one folder containing mp3 files, the folder is: C:\My Shared Folder\Rubber Soul And the files are: 01 drive my car.mp3 02 norwegian wood.mp3 03 you won't see me.mp3 04 nowhere man.mp3...
1
by: Tuan Nguyen | last post by:
Hello all, I have a website about 10 pages. One of them is login page. I am using Simple Form Authentication with database to allow user login and logout. My problem is whenever my website is...
11
by: ABC | last post by:
How to rename files with support wildcard ?
21
KevinADC
by: KevinADC | last post by:
Note: You may skip to the end of the article if all you want is the perl code. Introduction Uploading files from a local computer to a remote web server has many useful purposes, the most...
2
by: =?iso-8859-1?b?cultaQ==?= | last post by:
Hi, I would like to rename files (jpg's ones) using a text file containing the new names... Below is the code that doesn't work : ***** #!/usr/bin/python #-*- coding: utf-8 -*- from os...
1
by: ogo796 | last post by:
hi everyone i upload files everyday to the server using a php coded program , it works from other computers but not on the others. Could this be a problem with http headers of specific computers...
1
by: leoce7 | last post by:
I need some help renaming a file that has a full path length longer than MAX_PATH (>260). I can locate the files using WIN32 API ("\\?\" recognition for long paths, etc.) coding and have actually...
0
by: Albert-jan Roskam | last post by:
Hi John, Thanks! Using a higher xlrd version did the trick! Regarding your other remarks: -yep, input files with multiple sheets don't work yet. I kinda repressed that ;-) Spss outputs only...
2
by: puneetmca | last post by:
hi i want to insert employees DOB into database through html forms but my code is not working....only empty record is shown in the database in edob ..rest of the records are working...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.