Jump to content

Recommended Posts

Posted

Hi I need to rename a file using a batch file on all pc in the domain. What am I doing wrong if anybody can see any errors in the below script?

 

Thanks in advance

 

Rename C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Web Data Web Data-old

Posted

Thanks I have tried that but still doesn't work. Like this?

 

Rename "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\" Web Data Web Data-old

Posted (edited)
Rename "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Web Data" "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Web Data-old" Edited by jamesreedersmith
Spaces
Posted

Still Doesn't work getting..

 

The syntax of the command is incorrect?

 

Rename "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Web Data" "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Web Data-old"

Pause

 

 

Thanks

Posted

First because you have spaces in the script, try enclosing it in speech marks otherwise it will stop when it gets to a space. It needs to stop after web data" then I believe you need to type the full path again but with what your replacing it with so...

 

Rename "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Web Data" "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Web Data-old"

 

- - - Updated - - -

 

oh looks like I was beaten to it lol

Posted
if the file is something.exe or something.exe then yes you need the extension try going to the folder in command see what it sees there rather than in the gui
Posted

Still no joy even in dos it does not show file extension..?

 

Rename "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Web Data" "C:\Users\%username%\AppData\Local\Google\Chrome\User Data\Default\Web Data-old"

Pause

Posted

Because you have %username% in the path the script will only be valid for the person sat at the machine and logged onto it. It could be this causing the issue if you are deploying it out?

 

If this is some kind of logon script you should be ok, or you might try replacing "c:\users\%username%" with just "%userprofile%"

Posted
Do you know what file type this is?

 

Thanks

 

Not off hand, but if you look at it in WE and set it so's you can see all file extensions, that should tell you.

Posted (edited)
You don't need the second drive or path, just the name. And I reckon you need the full filename, including file type.

 

Thanks Gibson335 Your suggestion worked :)

 

You don't need the second drive or path, just the name. And I reckon you need the full filename, including file type. (didnt need the extension in the end)

Edited by itgeek

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...