forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Backup save relative path

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code
View previous topic :: View next topic  
Author Message
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Wed Mar 20, 2013 2:47 pm    Post subject: Backup save relative path Reply with quote

The biggest problem I have with backing things up to externals on the fly is saving the relative path info.

Label the volume of the drive "Backup" and compile this code. Make a shortcut to your executable in %APPDATA%\Microsoft\Windows\SendTo

NOTE: This does not handle multi-select, but it does handle entire folders.

Code:

if @equal(@volinfo(d,n),Backup)
file copy,%1,d:\@strdel(%1,1,3)
end

if @equal(@volinfo(e,n),Backup)
file copy,%1,e:\@strdel(%1,1,3)
end

if @equal(@volinfo(f,n),Backup)
file copy,%1,f:\@strdel(%1,1,3)
end

if @equal(@volinfo(g,n),Backup)
file copy,%1,g:\@strdel(%1,1,3)
end

if @equal(@volinfo(h,n),Backup)
file copy,%1,h:\@strdel(%1,1,3)
end

if @equal(@volinfo(i,n),Backup)
file copy,%1,i:\@strdel(%1,1,3)
end

if @equal(@volinfo(j,n),Backup)
file copy,%1,j:\@strdel(%1,1,3)
end

if @equal(@volinfo(k,n),Backup)
file copy,%1,k:\@strdel(%1,1,3)
end

if @equal(@volinfo(l,n),Backup)
file copy,%1,l:\@strdel(%1,1,3)
end

if @equal(@volinfo(m,n),Backup)
file copy,%1,m:\@strdel(%1,1,3)
end

if @equal(@volinfo(n,n),Backup)
file copy,%1,n:\@strdel(%1,1,3)
end

if @equal(@volinfo(o,n),Backup)
file copy,%1,o:\@strdel(%1,1,3)
end

if @equal(@volinfo(p,n),Backup)
file copy,%1,p:\@strdel(%1,1,3)
end

if @equal(@volinfo(q,n),Backup)
file copy,%1,q:\@strdel(%1,1,3)
end

if @equal(@volinfo(r,n),Backup)
file copy,%1,r:\@strdel(%1,1,3)
end

if @equal(@volinfo(s,n),Backup)
file copy,%1,s:\@strdel(%1,1,3)
end

if @equal(@volinfo(t,n),Backup)
file copy,%1,t:\@strdel(%1,1,3)
end

if @equal(@volinfo(u,n),Backup)
file copy,%1,u:\@strdel(%1,1,3)
end

if @equal(@volinfo(v,n),Backup)
file copy,%1,v:\@strdel(%1,1,3)
end

if @equal(@volinfo(w,n),Backup)
file copy,%1,w:\@strdel(%1,1,3)
end

if @equal(@volinfo(x,n),Backup)
file copy,%1,x:\@strdel(%1,1,3)
end

if @equal(@volinfo(y,n),Backup)
file copy,%1,y:\@strdel(%1,1,3)
end

if @equal(@volinfo(z,n),Backup)
file copy,%1,z:\@strdel(%1,1,3)
end


Super simple, super useful hack together code. It could have been coded more eloquently but "Ain't nobody got time for that!"

As an added bonus, this handles multiple backup volumes at once. One and done.
Back to top
View user's profile Send private message AIM Address
cnodnarb
Professional Member
Professional Member


Joined: 11 Sep 2002
Posts: 762
Location: Rockeledge, GA

PostPosted: Wed Mar 20, 2013 3:07 pm    Post subject: Reply with quote

For "Move to Backup" same code, but add

Code:

file delete,%1


at the end.
Back to top
View user's profile Send private message AIM Address
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Wed Mar 20, 2013 4:31 pm    Post subject: Reply with quote

you could also make that like a 5 line loop or less by adding a-z in a string and then move the char pos within the string by 1 each loop until you reach z. But yeah, nice for sure.
_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group