command copy in command promt - copy

ok I know this a really generic question but I nedd to copy a folder from command promt (I'm creating a .bat archive) but I can't make it work can somebody help me at least with the syntax. Thanks!!

In your .bat file first make the folder you want to copy to (if it doesn't exist)
mkdir destinationFolder
then copy files
copy soureFolder destinationFolder

Related

How to zip a list of files of the same type using jar command

I have a folder on my computer at the following path:
/path/to/folder/
This folder contains a subfolder and many cvs files
folder/subfolder
folder/1.cvs
folder/2.cvs
...
folder/n.cvs
Now, I would like to be able to zip all the .cvs files into one .zip file using the jar command (long story...)
The best I could come up with is:
jar -cvfM output.zip -C /path/to/folder .
This works, but inside output.zip I also see the subfolder, is there any way to avoid it? I tried using the * wildcard like this:
jar -cvfM output.zip -C /path/to/folder *.cvs
But it doesn't work.
Is it possible?
Thanks in advance

Change Directory to Folder Containing PowerShell Script - Regardless of Where That Folder Is Located

I have a script that I've created to prep our customer's servers for a software install. Part of this requires the script to be run as administrator, so just instructing people to click "Run With Powershell" doesn't get the job done. The script is in a folder with a number of .ini files that the script needs to copy to different server locations. If I just right-click the Powershell script and select "Run With Powershell," it is able to find the files and copy them without issue. Unfortunately, if I open the script in ISE, it opens with a default directory of C:\users\user, and I can't seem to copy those .ini files without first running a change directory command to get us to the folder that the script and the .ini files are in. But I'd like our installation techs to be able to run this without worrying about the exact location they initially drop these folders. I'd also like them to not have to worry about changing the directory manually in PowerShell. Some of our customers have multiple drives, and it might make sense to put this stuff on something other than the C drive, so it's hard to tell where this folder might end up. But I'm not sure of a command that will get me to the directory of the *.ps1 file, without knowing where that file is beforehand... Anyone have a suggestion?
You can use $PSScriptRoot that will have the location of the directory where the script is located.
This is referenced in the following post:
How can I get the file system location of a PowerShell script?

Find path from where .exe is run Autohotkey

I have a compiled ahk script in which I use %_A_WorkingDir% to get the current working directory. But now I'm calling the .exe from another file two folders up so %_A_WorkingDir% returns the directory that is two folders up, not the location of the actual .exe. How do I fix this issue?
A_WorkingDir is the directory in which the script is currently
working. You can change it by using
the command SetWorkingDir.
A_ScriptDir is the full path of the directory where the script is in.
A_ScriptFullPath is the full path of the current script.
https://autohotkey.com/docs/Variables.htm#prop

How to move a .tar.gz file from one directory to another directory

i have a file latest.tar.gz i have to move this file to another folder.
example: file is in this path root/home/phani
i have to move this file to root/san/newwebsite/
am new to centOS pls help me grt out of from this.
In a shell window, type:
mv /root/home/phani/latest.tar.gz /root/san/newwebsite/

using visual studio command to copy files into outdir

In my project under "Resource Files" I have some properties files that I'd like to be copied to the output directory. The idea is that I could just give my output directory to someone else and they'd automatically read the properties files within the bin/output directory.
I believe the way I'd go about doing this is to add a build event command line command and use the XCOPY or COPY commannds. After having looked through the help for XCOPY the command is just
XCOPY src dest
And I used the command: XCOPY $(InputDir)/properties.conf $(OutDir)/properties.conf
but it says it cannot find the file. So I tried to find out what $(InputDir) points to, since other people got it to work, but the 'set' command in the VS command line tool only shows system env. variables and not ones available to vcprojects.
Any ideas on how to get this to work? Maybe there's a different way to do it?
SOLN: Just used "COPY properties.conf $(OutDir)\properties.conf"
just used "COPY properties.conf $(OutDir)\properties.conf"