I can use cd command to open folder, but can not see folder both in cmd or explorer - xcopy

When preparing to reinstall Windows OS, I use xcopy to backup a partition (driver letter D) to folder E:\Backup200407
Command line:
xcopy D:\ E:\Backup200407\ /E /C /Y
After copy, I can use cd command to open folder E:\Backup200407
But I can't see it with dir command, or open E:\ in explorer
dir

Related

Make xcopy show what will be copied on prompt

I'm using xcopy command in Windows to deploy to a server. I use the switch /w that lets xcopy wait for user confirmation, before it executes (displays "Press any key to begin copying file(s)"). I also use a bunch of other switches, to only copy the files that I need (full command below).
Can I somehow make xcopy check which files will be copied, display them on the screen and then wait for my confirmation? That will help identify if something is up, before I execute the command and fumble the server with the wrong files.
The /l switch should do it according to the docs (Displays a list of files that are to be copied.), but nothing shows up except the "Press any key..."? Does the other switches I use prohibit the /l switch...? After I press a key, the files are listed, but also immediately copied.
My command:
cmd /k xcopy "../03_App/" "[some path to the destination server]" /v /w /f /d /e /s /z /y

How to solve " 'takeown' is not recognized as an internal or external command "

I am trying to uninstall cygwin debugger from my system. In order to uninstall we have to take ownership of the application.
But when I enter takeown command it says 'takeown' is not recognized as internal or external command. (I have tried it in administrator CMD still same problem)
This command takes ownership recursive of the folder, without asking anything:
takeown /r /d y /f cygwin
This command gives Full Access to Everyone recursively in the folder:
icacls cygwin /t /grant Everyone:F
And finally, the command which deletes it all and removes Cygwin:
rmdir /s /q cygwin

Windows 7 commands- copy a file with a specific Name from a folder with dynamic folder name

C:\Automateinstaller\#*.*\cucumber-junitreport.xml C:\destin /Y /H /E /F /I
I am using above command but not able to copy the cucumber-junitreport.xml file to "destin" folder can anyone help me with this
Here the folder with dynamic name always with # in its name

Execute bat file from same folder

I have a Bat file with
"C:\Program Files (x86)\Jenkins\jre\bin/java" -jar "C:\Program Files (x86)\Jenkins/war/web-inf/jenkins-cli.jar" -s "http://localhost:8080" create-job "buildjob" < "config.xml"
"C:\Program Files (x86)\Jenkins\jre\bin/java" -jar "C:\Program Files (x86)\Jenkins/war/web-inf/jenkins-cli.jar" -s "http://localhost:8080" safe-restart
"C:\Program Files (x86)\Jenkins\jre\bin/java" -jar "C:\Program Files (x86)\Jenkins/war/web-inf/jenkins-cli.jar" -s "http://localhost:8080" build buildjob -p "Path=/" -w -s
I couldn't get this running directly in PowerShell, so I put it into a bat file in the same folder as the script and added
cmd.exe /c 'ConfigureJenkinsJob.bat'
But that gives an error that the system couldn't find the specified file.
The command is trying to run the batch file from the current working directory, which isn't necessarily the same folder in which the scripts reside. If you need to run another script from the same folder, use the $MyInvocation automatic variable to determine the parent folder:
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path
cmd.exe /c "$dir\ConfigureJenkinsJob.bat"
Instead of using cmd /c you could also simply use the call operator (&), since batch files can be run directly from PowerShell:
$dir = Split-Path -Parent $MyInvocation.MyCommand.Path
& "$dir\ConfigureJenkinsJob.bat"

Using xcopy to move files

Having some trouble. Trying to copy some files from a network share to the local user profile for a user on XP. I'm getting an "invalid drive specification" message when I try to run my .bat script.
Any suggestions would be helpful. Below is my script:
#echo off &setlocal
if exist "%userprofile%\SapWorkDir\" xcopy "\\serverip\folder\" "%userprofile%\SapWorkDir\" /i /q /s /y /z &&
echo New folder 1 copied successfully || echo copied NOT successfully