itgeek Posted October 2, 2014 Posted October 2, 2014 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
jamesreedersmith Posted October 2, 2014 Posted October 2, 2014 Put the path in speech marks as it has spaces in it!
itgeek Posted October 2, 2014 Author Posted October 2, 2014 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
sted Posted October 2, 2014 Posted October 2, 2014 you need a full destination path (and probably in "" too)
jamesreedersmith Posted October 2, 2014 Posted October 2, 2014 (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 October 2, 2014 by jamesreedersmith Spaces
itgeek Posted October 2, 2014 Author Posted October 2, 2014 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
itgeek Posted October 2, 2014 Author Posted October 2, 2014 Do I need to put the file extension? If so it doesn't have one just says file?
jonnykewell1 Posted October 2, 2014 Posted October 2, 2014 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
sted Posted October 2, 2014 Posted October 2, 2014 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
itgeek Posted October 2, 2014 Author Posted October 2, 2014 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
themightymrp Posted October 2, 2014 Posted October 2, 2014 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%"
Gibson335 Posted October 2, 2014 Posted October 2, 2014 You don't need the second drive or path, just the name. And I reckon you need the full filename, including file type.
itgeek Posted October 2, 2014 Author Posted October 2, 2014 Do you know what file type this is? Thanks
Gibson335 Posted October 2, 2014 Posted October 2, 2014 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.
itgeek Posted October 2, 2014 Author Posted October 2, 2014 (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 October 2, 2014 by itgeek
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now