I am trying to make an installer and i need to create a folder in Program Files (x86).
I created a batch file with the following code:
#echo off
copy /s "c:\Users\%USERNAME%\Desktop\MagicPanelInst\magicpanel" "c:\Program Files (x86)\Common Files\Adobe\CEP\extensions\"
I pretend to copy from magicpanel from the source to the already existing folder extensions in the target...
But is created in c: a new folder called Program Files (x86) with all the directories described above, instead of copy the magicpanel folder to the existing one.
Any help please?
Now it is working with the below code.
xcopy /s "c:\Users\%USERNAME%\Desktop\MagicPanelInst\magicpanel" "%programfiles(x86)%\Common Files\Adobe\CEP\extensions\magicpanel" /i
Or even better:
xcopy /s "%UserProfile%\Desktop\MagicPanelInst\magicpanel" "%CommonProgramFiles(x86)%\Adobe\CEP\extensions\magicpanel" /i
Thank you all for the help.
Related
I'd like to create a batch file that creates a directory symbolic link for My Pictures - in the Downloads folder...
mklink /D "%USERPROFILE%\Downloads\Pictures" "%USERPROFILE%\Pictures\Saved Pictures"
But the above doesn't work
I am solving some problems, two of the are backup and restore file with batch file.
I have found out using xcopy command to backup files,
xcopy "%programfiles(x86)%\VMware" "C:\Backup" /s /c /d /e /h /i /r /y
but I still have some problems with the restore the backup files which should restore in a new folder and restore in an existing folder.
I searched on some website, some code use the same xcopy command and changed source/destination directory to restore file. Is there a command for restore or everyone changes their directory to restore files?
You have to use robocopy for that. I have successfully implemented using that. You can use xcopy if you want. During backup you can save the backups inside a folder which is named based on current date and time. You can find last or range of files and folders in the backup directory. Which you need to mirror in the destination directory
xcopy "D:\CCStudio\rtos" panasonic /s /e
The folder panasonic and the bat file are on the same level in the directory structure, although on another machine I have access to.
When I use the bat script on my PC everything works fine. But when I put the bat script into the remote shared folder, it doesn't work as expected. The problem seems not to be the source, instead the destination address is the key in the problem. When I replace `pansonic' whit its absolute address, the script works.
So why should I specify absolute path for destination? Recall that the destination is external path. It is shared folder on another windows machine.
I currently run a bat from a shared drive to copy to another shared drive. This is what I use to get it working fine. Adjust as needed.
cd /d %~dp0
xcopy /s "D:\CCStudio\rtos" "panasonic\" /E
cd /d %~dp0 will change the directory to what ever the batch file is in allowing you to use relative paths. This script will copy the files in rtos to panasonic. Folder path will look something like this X:\Shared\Network\panasonic\RtosFiles.ini assuming RtosFiles.ini was in D:\CCStudio\rtos and the batch was run in X:\Shared\Network\
I’m looking to create a batch file that transfers all my music from my external drive to my Samsung note 3. The idea is just to click the batch file and for it to update any song on my external on my phone.
Heres what I’ve got
XCOPY "E:\Music\*.*" "Computer\SAMSUNG-SM-N900A\Phone\Music\" /e /c /r /k /y /v
The problem I see is that it’s creating a folder on my desktop with that path, the directory on my desktop being computer with the following subfolders.
I’m not sure why it won’t recognize the path, any ideas?
You can't directly copy files from windows to an android device, its a different file system. You can probably do it manually with this program:
https://android-file-manager.en.softonic.com/
My 7-zip is installed in
C:\Program Files\7-Zip
and my source log file location is
E:\OracleGrid\11.2.0\grid\log\diag\tnslsnr\enctcorl010\listener\trace\listener.log
There is only one log file in there. I want to zip it by renaming name like current date LISTNER_DDMMYY.ZIP to new destination to
E:\DBA_CMDS\Maintenance_Tasks\ClearListenerLog\ArchivedListenerLogs
I would appreciate if someone can help me to write in batch script since I am new to this script. I appreciate your help.
Try this:
#ECHO OFF
"c:\program files\7-zip\7z" a E:\DBA_CMDS\Maintenance_Tasks\ClearListenerLog\ArchivedListenerLogs\listen_%date:~7,2%%date:~4,2%%date:~12,2%.zip E:\OracleGrid\11.2.0\grid\log\diag\tnslsnr\enctcorl010\listener\trace\listener.log
IF ERRORLEVEL 0 DEL E:\OracleGrid\11.2.0\grid\log\diag\tnslsnr\enctcorl010\listener\trace\listener.log
This assumes that the 7-zip command line has been installed in the 7-zip directory you mention. It is a separate download / install.
HTH.