Batch file not able to run after upgrade to window10
Batch file not able to run after upgrade to window10
I have a batch file which worked well in window 7. After got new computer with window 10, the batch file will not able to run anymore.
What happens is if I right click on the batch file and Run as administration and Window command just launch and disappear (Batch file not able to run).
Please help and thank you.
I have them like this:
@echo off
REM (c) 2015
CLS
TITLE file finder
REM finds files in list.txt file and copies them to C:copied REM CHECK FOR ADMIN RIGHTS
COPY /b/y NUL %WINDIR%6CF2EB6-94E6-4a60-91D8-AB945AE8CF38 >NUL 2>&1
IF ERRORLEVEL 1 GOTO:NONADMIN
DEL %WINDIR%6CF2EB6-94E6-4a60-91D8-AB945AE8CF38 >NUL 2>&1
:ADMIN
REM GOT ADMIN RIGHTS
COLOR 1F
ECHO Hi, %USERNAME%!
ECHO Please wait...
FOR /R "%~dp0" %%I IN (.) DO for /f "usebackq delims=" %%a in ("%~dp0list.txt") do echo d |xcopy "%%I%%a" "C:your_files" /s /i
COLOR 2F
ECHO.
ECHO (c) Copying done PAUSE
GOTO:EOF
:NONADMIN REM NO ADMIN RIGHTS
COLOR 4F ECHO.
ECHO PLEASE RUN AS ADMINISTRATOR
ECHO. pause
GOTO:EOF
What happens if you start a command prompt and then execute the batch file from within it? You may be getting a useful error message, but the console window is closing too fast.
– Jeff Zeitlin
Sep 6 '18 at 15:12
GUID directory names are likely to change between Windows versions, updates, machines and users. Are you sure the GUID's in your script are actually stable?
– jwdonahue
Sep 6 '18 at 15:45
0
Thanks for contributing an answer to Stack Overflow!
But avoid …
To learn more, see our tips on writing great answers.
Required, but never shown
Required, but never shown
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
What error do you get when you run the script from the command prompt instead of double-clicking it?
– SomethingDark
Sep 6 '18 at 15:12