Computing.Net > Forums > Windows 95/98 > Rename file shortcut

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Rename file shortcut

Reply to Message Icon

Name: G1952
Date: March 20, 2005 at 13:09:36 Pacific
OS: Windows 98SE
CPU/Ram: 486/32MB
Comment:


How would I create a shortcut ib my desktop where I could rename a given file (if I could)?



Sponsored Link
Ads by Google

Response Number 1
Name: Jennifer SUMN
Date: March 20, 2005 at 13:24:11 Pacific
Reply:

Create a batch file that renames the file you wish to rename and then run that batch file.


0

Response Number 2
Name: Derek
Date: March 20, 2005 at 13:30:16 Pacific
Reply:

Fine if you always want to rename the same file. If you can say exactly what you want to do I daresay we can help with the script.

I happen to do this with batch files, so that various programs reset to my favoured setup next time they start.

Derek.W


0

Response Number 3
Name: G1952
Date: March 20, 2005 at 15:19:40 Pacific
Reply:


I would appreciate it if you would show me how to create a batch file; I've never done it before. I'm relatively inexperienced at computers.


0

Response Number 4
Name: jboy
Date: March 20, 2005 at 15:29:36 Pacific
Reply:

Creating a batch file is simplicity itself - you just use a text editor such as notepad or even DOS Edit and enter the commands you want executed - save the resulting file using the .BAT extension.


You have to have a fairly precise idea of what you hope to accomplish - generalities won't do.

Braccae tuae aperiuntur


0

Response Number 5
Name: Derek
Date: March 20, 2005 at 16:32:13 Pacific
Reply:

Here's an example from part of one of my own batch files.

I wanted to rename the file english.lng to english.dw (which is in the folder c:\program files\a2 free\languages)

To run it in Windows this was my batch file:

@echo off
ren "c:\program files\a2 free\languages\english.lng" "english.dw"
cls

The "@echo off" line just prevents it from repeating things in the DOS window (not essential). The cls at the end closes the screen when you exit from the batch file. There is no Return at the end of the batch file (cls in this case). The quotes tell it to recognise long folder/file names.

If I want this to run this from true DOS you can't use long file names anyway, so I don't need the quotes. Each long folder (directory) name or file name has to be reduced to 8 characters max using ~ symbol, followed by 1 unless there are other folders/files that would look the same when shortened. Here's the true DOS version:

@echo off
ren c:\progra~1\a2free~1\langua~1\english.lng english.dw
cls

NOTE that the first example has wrapped around on here. Line two should not have wrapped around and there is one space after english.lng" as per the second example.

Maybe I should explain that tilda symbol part (~). Suppose that in one folder you had a file called "elephants trunk.doc" and in the same folder you had another file called "elephants tail.doc". When these are reduced to 8 characters in DOS then the two files would appear like this:

elepha~1.doc

elepha~2.doc

This is necessary because you can't have two files with the same name. Note that the DOS names are how the file is really known by the system (long file names are just for the convenience of us humans). If you want to know what the long file name world looks like then just type winfile in the Run box and hit Return key. What you see will be the short file name version of Windows Explorer (more correct than WE actually)

Once you have produced your batch file (which is nothing more than a series of DOS commands) then you save it in the form File.bat

If you want to run it from the desktop you can either put the file itself there or make a shortcut to it.

The trick with batch files is to understand DOS commands first. Then you put them one after the other and away you go.

We can help with the script but we would need to know the exact file name and path that you want to rename.

Derek.W


0

Related Posts

See More



Response Number 6
Name: SkipCox
Date: March 20, 2005 at 18:49:28 Pacific
Reply:

One recommendation Gary...learn about batch files in the manner Derek has it laid out. You'll soon be able to do a lot of work with a click or two.

You'll find programs available that will "write" a batch file for you. Stay very far away from that sort of thing; I can't make 'em work and I've been writing batch files for fifteen years.

Skip


0

Response Number 7
Name: G1952
Date: March 20, 2005 at 19:07:37 Pacific
Reply:


I want to rename my Host file Host.txt. It's in C:\Windows.


0

Response Number 8
Name: Derek
Date: March 20, 2005 at 19:25:14 Pacific
Reply:

Not the best way to learn but here it is, exactly the way
I said:


@echo off
ren c:\windows\hosts hosts.txt
cls


The only thing that is unusual is that hosts is one of the few files that has no extension.

If you want one that changes it back again then it's this:


@echo off
ren c:\windows\hosts.txt hosts
cls


ren means rename. Note the space between the two file names. Nothing more than 8 characters, so no tilda's or quotes. Get the idea?

Good luck

Derek.W



0

Response Number 9
Name: jboy
Date: March 20, 2005 at 19:46:39 Pacific
Reply:

Batch files are employed to perform repetitive tasks with minimal effort on the user's part.

Renaming a single file once does not require a batchfile - just the DOS command:

ren c:\windows\hosts hosts.txt

Done

.. of course, you realize (I hope) that once renamed, that file will no longer perform its original function.

Braccae tuae aperiuntur


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Windows 95/98 Forum Home


Sponsored links

Ads by Google


Results for: Rename file shortcut

renaming files with win98 www.computing.net/answers/windows-95/renaming-files-with-win98/18529.html

Renaming files www.computing.net/answers/windows-95/renaming-files/55039.html

renaming files didn't work www.computing.net/answers/windows-95/renaming-files-didnt-work/87450.html