Batch Rename In DOS Or Windows PowerShell

Jan 15, 2013

So, I have this for batch renaming files in a folder:
Dir | rename-item -newname { $_.name -replace "oldname","newname" }

And it works like a charm. The thing I can not figure out how to do is add characters - w/o changing any. So let's say I have 3 files: 1.txt 2.txt and 3.txt - I want to change them to be x1.txt x2.txt and x3.txt

So I try replacing 'replace' with 'add' like this:
Dir | rename-item -newname { $_.name -add "x", }

But it doesn't work. Is this possible, and if so, what I am missing in my command line?

View 1 Replies


ADVERTISEMENT

Delete / Rename Through Batch Files?

May 16, 2011

So I'm trying to make a personal shortcut on my computer to change a password using the shiftkeys .exe (C:WindowsSystem32sethc.exe) which can be done from setup.I'm looking to design this because I frequently deal with friends and family who have forgotten passwords, as well as my purchasing used computers.I want to automate the process, but I've hit a problem, which is making the batch file remove itself.I have a .exe file replace sethc.exe, with sethc.exe renamed to sethc.exe.I'm using the following lines Code: del sethc.exeren sethc2.exe sethc.exedel %0 The batch file deletes itself successfully (del %0), but it's completely failing at the removal of the .exe and the renaming. I've tried changing the targeting, checking the syntax, but as far as I can tell, everything checks out, yet it still fails.

View 6 Replies View Related

Batch File Or Exe To Copy & Rename Directory And Update Files

Apr 28, 2012

I require a batch file or free utility that i can redistribute from my web site to other users, (gamers) that will copy the contents of a directory inside their game to a new location and re-name the directory at the same time. Something like this; Copy "GenesisVehicleruck diesel4tonbaker"to "GenesisVehicleruckdiesel4tonbutcher".The batch file needs to be run without the need for a command line box being opened, that is, if the user can double click on it or run it with a 'right click' that would be great. Problem there is, I maybe need an exe file not a batch file. The other part of the problem is that the folder to be copied may or may not be in the same location on every PC that runs the file. It may be the case that the 4tonbaker folder is on; [code] and I require the end user to have no need to know, just for the directory to be copied and renamed when and where it is found.If possible I then want the batch file to perform a second task. I want to distribute a folder, lets say it is 4tonbutcher and in that folder there are files lets say doc1.txt, doc2.txt and doc3.txt.On any given users PC 4tonbaker has these same named files but the content is different to the ones in my folder 4tonbutcher, I want to update the newly created folder, 4tonbutcher with the new txt files I distribute.

So, User downloads a folder called 4tonbutcher from my site.Batch file copies and renames a folder from a location on the users PC, "Genesis Vehiclesruckdiesel4tonbaker" to "Genesis Vehiclesruckdiesel4tonbutcher".Batch file copies doc1.txt, doc2.txt and doc3.txt from the downloaded folder to the newly created folder 4tonbutcher.

View 1 Replies View Related

Windows PowerShell

Nov 25, 2010

How to Open Windows PowerShell in Windows 7 ?

View 0 Replies View Related

'Rename' Box Doesn't Show Up When Rename A File Shortcut

Sep 30, 2012

basically (I'll try to be descriptive), I have an Excel file (extension xlsm) on my USB and I right click it, send to --> desktop (create shortcut). I see the shortcut. I right click and attempt to rename it with a different file extension, but the 'Rename' box doesn't show up like I believe it should and the file name changes without the warning. I need to do this for the shortcut I've created, not the file on the USB.I have 'Hide extensions for known file types' unchecked and 'Display the full path in the title bar' checked, as I believe they should be.

View 4 Replies View Related

Windows Powershell Vs Command Prompt

Mar 27, 2012

What is the main difference between Powershell and Command Prompt? I use cmd quite a lot, and I know that certain functions in Powershell, such as diskpart, gets referred to command prompt, then what is the use for powershell? Why should one use it and what is the main benefit of using it?

View 3 Replies View Related

Simple PowerShell Command To Shutdown Windows?

Apr 26, 2012

Is there a simple PowerShell command to shutdown Windows?

View 1 Replies View Related

Create A Batch File That Runs 3 Other Batch Files

Jul 1, 2011

I am trying to create a batch file that runs 3 other batch files. Right now, it works fine using the call command on each other batch file. However, these other batch files take awhile to run. and so the entire process takes a very long time, since each "sub" batch file is run only after the previous one is finished.I was wondering if there is a command or way to start a batch file fro the top-level batch file, then go on and start the next batch file before the previous one is finished. In other words, I want the sub batch files to run in parallel in the background. (similar to the '&' in Unix).

View 1 Replies View Related

PowerShell Logon Script?

Aug 24, 2010

Ok, so this doesn't necessarily have to do with Windows 7, but I originally wanted to reply to a post on Vista forums and somehow I ended up here. Anyway...I actually tried all of this on Windows Server 2008 - set policies, scripts and logged on there.Here's one way that actually works. 1) created a logonScript.ps1 file with whatever in it for the actual logon script. 2) created GPO with a policy for running a logon script and specified a vbScript file: launcher.vbs. 3) put those two files in the same folder related to the policy if you know what I mean[CODE]

View 1 Replies View Related

Powershell (Outlook 2010) - Converting PST To XML

Jul 19, 2011

knowledge in powershell to explain how i should go about using the outlook comobject to either: A) Convert a specific PST i.e. "c:mail est.pst" to XML or i'll even settle for CSV B) Read the full PST and display the Raw Data I'm just getting familiar with the following:

$ol = new-object -comobject "Outlook.Application"

View 1 Replies View Related

Can't Rename A File On My PC Windows 7

Feb 17, 2012

How can i rename a file on my computer Win7?

View 2 Replies View Related

How To Rename Files In Windows 7

Oct 1, 2012

How to rename files in Windows 7

[code]...

View 1 Replies View Related

Rename C:program To C:program1 On Windows 7?

Jun 26, 2012

The message keeps popping up whenever I turn on computer

View 1 Replies View Related

How To Rename Windows 7 Restore Point

Sep 25, 2011

I created a restore point but fatfingered the description and it's bugging me. I want to rename it (the text in the "description" column of the restore point). I know restore points are in the System Volume folder and I deprotected the one for the C: volume to the extent.

I could and tried to recursively grep it in an administrator shell but many files were still "permission denied". Anyone know the exact files where the descriptions of the restore points are located? (I searched the registry without luck, so I assume they're in that directory with the actual data from the restore point.)

View 1 Replies View Related

How To Make Windows 7 Rename The Files

Jan 16, 2013

how to make windows 7 rename the files i download in a series.I can't tell much about the work am going to use this auto rename for much because it's confidential.how i want it to be done.Basically i download "things" from a certain site for a certain use and i want to rename the downloads as something else.Basically, I would like my downloads to be renamed in the series of 1, 2, 3 etc automatically once i feed 1 manually for the first file i download.

View 1 Replies View Related

Copy And Rename Language In Windows 7?

Jul 3, 2012

English is spoken all over the world. Windows have option of EN (US), EN (UK), EN (IN) etc, I want to copy EN (UK) and rename it with my own country's format (currency, date & time styles etc) as EN (PK)*

View 1 Replies View Related

How To Rename Folder Name With Trailing Dot In Windows 7

Mar 7, 2012

how to rename folder name with trailing dot in window 7?

View 1 Replies View Related

How To Rename 'start' Text In Windows 7

Jul 24, 2012

How to rename 'start' text in windows 7

View 1 Replies View Related

Why Can't Delete / Rename Folders In Windows 7 Ultimate

Sep 18, 2011

I have installed windows 7 ultimate, but I noticed when I am trying to delete some files/folders can't execute it, the files or folders targeted to be deleted are unused and totally closed..

View 12 Replies View Related

Windows Folder Icon Changing On Rename

Jun 29, 2012

I am having very bizarre behavior with the folder icon changing when I rename a folder. On my C: drive, I have a folder named mydata. I created it using Google Drive, and renamed it to mydata. The folder at first showed the Google Drive triangle icon, and now shows the recycling arrows on folder icon, showing it needs updating. So far, so good.

I now created a separate folder on my C: drive named "mydata backup". Upon creation of the folder, it gets the google drive icon (recycling arrows). If I create a folder with any other name, it gets the standard folder icon. If I rename a folder to "mydata anything", it immediately takes on the google drive icon! If I rename it to "xmydata anything", it goes back to the normal folder icon!

I doubt that Google Drive is changing the icon, since in theory it doesn't know about a new folder or a folder rename outside of the folder it controls, so I assume the icon change comes from Windows 7 itself. Has anyone seen anything like this? If not, I will go to the Google Drive people and see if they have an answer.

View 1 Replies View Related

Rename Sources Folder Or Install.wim In Windows 7?

Jul 19, 2010

How to rename Sources Folder or install.wim in windows 7 ?

View 2 Replies View Related

Windows 7 Can't Rename / Delete / Move Mkv Files

Jun 15, 2012

My computer has been acting a little weird lately. Recently i've downloaded some .mkv files and now i can't rename or delete or move them. I tried using command prompt and unlocker and it's still not working. It says "action can't be completed because it is being opened by other programme", i don't get this as i close all programmes and it still says the same thing.

My main purpose is to actually move them into another folder. It's only these few days that my computer is acting like this. I can move/delete/rename other avi or mp4 files.

View 5 Replies View Related

Can't Rename A File As It Crashes Windows Explorer

May 22, 2011

I have a .mkv file that when I click on the folder it is in, it restarts windows explorer?? I cant rename or delete it as it crashes straight away.

View 3 Replies View Related

Windows Explorer Doesn't Refresh After Copy / Rename / New Or Delete

Jan 29, 2012

Usually, when you create/rename/delete a file/folder in the directory in Windows Explorer, it will add/renamed/remove automatically without refreshing.However, I have this issue where if you do any of the above, it doesn't refresh until you press F5. I tried to see if its a driver issue by booting into Safe Mode but it didn't work in there.

View 1 Replies View Related

Batch File In Windows 7?

Aug 21, 2011

Can someone show what a batch file would look like for use in Win7?Secondly the method for writing same batch file please.I want copy a file or files to the desktop before shutting down or rebooting and secondly copy same file/files to their original location after booting.

View 2 Replies View Related

Batch File To .exe In Windows 7?

Sep 15, 2010

How can I convert a batch file (script) into .exe file in Windows 7?

View 4 Replies View Related

Windows 7 Column File Properties, Rename, Customize Sort Fields?

Aug 12, 2011

Is there a way to rename or create new sorting option with custom text ?there is a lot of categories, however i need to have my own custom labeled field then in the Detail view panel, by default, in the small size, there are these fields ready to edit:

- tags
- categories
- content status

the easiest way would be if i could rename those to my needs so it stays easily editable for the user?

View 1 Replies View Related

Edit / Rename Boot Menu Entries And Hide Other Windows 7 Partitions?

Sep 20, 2010

On my computer I have 3 primary partitions:

1. "System reserve" which contains e.g.the Bootmamanger and MBR
2. First Win 7 installation ("main")
3. Second Win 7 installation ("reserve")

When I boot now at first the Bootmanager on the first primary partition is called/started which in turn starts the boot menu. In the boot menu there are currently two entries:

Windows 7
Windows 7

So I cannot distinguish between the "main" and the "reserve" Win 7 installation. How exactly can I modify/rename the two "Windows 7" entries in boot menu? After selecting and booting the actual Windows 7 installation the other Windows 7 installation is visible as a separate partition in WinExplorer:

C: Running Windows 7
D: DVD drive
E: Other (non-booted) Windows 7

How can I automatically hide the other Windows 7 installation? The drive E: should be available e.g. for USB sticks or network drives.

View 1 Replies View Related

Batch File Error Windows 7 X64

Nov 17, 2010

Tried writing a batch file to open a few programs I use together regularly, but which I don't want all the time on startup.I've tried:

start �Maxivista� /d �C:Program FilesMaxiVista Pro ServerMaxiVistaAll.exe"
start �Netbeans� /d "R:Program FilesNetBeans 6.9.1in
etbeans.exe"
start �OfficeTime� /d "C:Program Files (x86)OfficeTimeOfficeTime.exe"
Start "WampServer" /d "R:wampwampmanager.exe"

[code]....

I've tried setting it to run as Admin, but the check-box is greyed out....

View 5 Replies View Related

How To Execute A MS-DOS Batch File In Windows 7

Mar 28, 2012

How to execute a MS-DOS Batch File in Windows 7?

View 2 Replies View Related

How To Execute A MS-DOS Batch File In Windows 7

Mar 28, 2012

How to execute a MS-DOS Batch File in Windows 7?

View 16 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved