473,473 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Batch file program to copy folder from one drive to another.

yoda
291 Contributor
This script needs to be copy folder lets say D:\windows\*me* to C:\windows\*me*. The problem I'm having is the *me* being a variable. So *me* always changes to who ever logs into the machine. So the real question is how to i make *me* in the file path change to whoever is logged in?

Thanks in advance,

Yoda.
Jul 29 '10 #1
3 5233
tetrahedral
7 New Member
The %userprofile% variable refers to the currently logged in user's home directory (so the user's desktop would be "%userprofile%\Desktop" for instance).

Alternatively, %allusersprofile% will work for all user accounts on that system.

Hope this helps!
Jul 29 '10 #2
Oralloy
988 Recognized Expert Contributor
Expand|Select|Wrap|Line Numbers
  1. xcopy /s d:\windoze\%username% c:\windoze\%username%
Jul 29 '10 #3
yoda
291 Contributor
Thanks so much tetrahedral and Oralloy that really helped me out, I'll post code when i'm done :)

Thanks,

Yoda
Jul 29 '10 #4

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

Similar topics

0
by: SkySea | last post by:
Hi! Any help on this would be appreciated... In an HTML document that lists instructions on installing some software, there's a point where a DOS batch file needs to be run in order to copy...
14
by: Mark C. | last post by:
I'm trying to call a batch file that I've built using the FileSystemObject and CreateObject("Wscript.Shell"), oShell.Run... in an asp script. Naturally, I can get the script to work from a command...
5
by: Bob Darlington | last post by:
I want to run the following batch file from Scheduler each night from a command line: 'm:\dpc data\createbackup.bat' The batch file is simply: ECHO Off Start createbackup.mdb where...
14
by: Realtime | last post by:
Lets say i have a file with the name atest.doc and its in the directory www/directory1 but i want to move that file using php to www/directory2/ how do i do this i tried move_uploaded_file()...
1
by: bballpinhead | last post by:
I am trying to figure out if there is code to move a PDF file from one folder to another in Access 2003. Just wondering if anyone has any suggestions? Ken
5
by: Dixie | last post by:
I am trying to write a simple on click procedure to copy a file who's name is in a combo box on the form to another folder and overwrite the file by the same name which is already there. I have...
1
by: fanoftvb | last post by:
Hi, i need to copy a folder to another folder. Can someone show me how to do it? I'm using vb 2005 Thanks.
5
by: CoachBarker | last post by:
I have an application that captures a video and saves it as a wmv file to a local folder. What I need to be able to is that on the click of the button that will stop the video and save it to the...
0
by: gabrielk43 | last post by:
Hi to all, I have made a web service which creates a batch file in a folder in web server and tries to execute it (in a Windows Server 2003 web server). So far I have managed to create the batch...
0
by: myself337 | last post by:
in VB you can do this: Imports System Imports System.IO Module Module1 Sub Main() Dim path As String = "c:\temp\filetocopy.txt" ' put the file you
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,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.