473,387 Members | 1,476 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,387 software developers and data experts.

renaming of subfolders

Hi,
We are taking backups for different databases in the same folder with date and time.I am copying those backups to other server,in that
I want to rename those backups without date and time format for other purpose.
can i get any syntax using xp_cmd_shell.
Pls find the following code and give me your advice.

declare @currentFolderPath varchar(256)
declare @command varchar(1000)
declare @result varchar(1000)
declare @dbname sysname
declare @destinationfolder varchar(1000)
declare @output varchar(1000)
set @currentFolderPath=' E:\TEST4\'
set @destinationfolder=@currentfolderpath + '\*.* ' + '.BAK'
set @dbname='abc'
set @output=@currentFolderPath + @dbname + '.BAK'
SET @command = 'RENAME ' + @destinationfolder + @output
print @command
EXEC @result = XP_CMDSHELL @command, NO_OUTPUT
for this code the output is::: RENAME E:\TEST4\\*.* .BAK E:\TEST4\abc.BAK
Jul 10 '07 #1
0 758

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

Similar topics

1
by: Kris | last post by:
Question: How do you create an Installer program using the Package and Deployment Wizard provided by Visual Studio Pro 6.0 (SP5) to include subfolders and their contents. I understand how to...
9
by: Tom | last post by:
How do you programatically get a list of subfolders in a folder? Thanks! Tom
3
by: TK | last post by:
Excuse me for multiple posting because I've posted this message to aspnet.security NG but have not got any response yet. I'm building an ASP.NET application works in Forms Authentication mode...
9
by: Bill Nguyen | last post by:
I need a VB routine to loop thru a select top folder to find all subfolders and list all subfolders/files under each of these subfolders. Any help is greatly appreciated. Bill
5
by: Robertico | last post by:
Is it possible to upload a complete folder including the subfolders using PHP ? Regards, Robertico
3
by: rdemyan via AccessMonster.com | last post by:
How do I get the names of the task subfolders from Outlook? Also, when I right click on the "Tasks" folder in Outlook, I don't have the option to rename it. So, can I assume that this folder name...
2
by: Tatyana | last post by:
Hello, I was wondering if anybody know how to fix the problem with JavaScript in subfolders. I have the following in <body>
0
by: grant | last post by:
Has anyone got a sample db that has a form to list an Outlook inbox and subfolders? I want to be able to mimic the tree style list of folders in Outlook so the user can browse the contents on...
9
by: OWeb | last post by:
Javascript and recursing subfolders assistance ------------------------- I have this script that is a free extra download from SlideShowPro. It's a great script but I feel it needs to be...
2
by: pbrown | last post by:
Hey All, My problem appears to be pretty simple. I need a way of listing all the folders that exist in a certain directory. By all the folders, I mean ALL the folders; any file folder that exists...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.