RTK999 Posted December 8, 2007 Posted December 8, 2007 (edited) Hi i have this problem how i can run this instruction from a cmd file:FOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\CD.txt SET CDROM=%%i:SET PP=%CDROM%\Software\SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY%\005 /VE /D "Test" /fREG ADD %KEY%\005 /V 1 /D "CMD.exe /C XCOPY \"%PP%Ztest\Data\" \"%SYSTEMDRIVE%\Ztest\Data\" /E /Y /I" /fso i want this:a cmd file that contain this instruction XCOPY "Data" "%SYSTEMDRIVE%\Ztest\Data\" /E /Y /I ,to copy those files and call in runonceex.cmd so:REG ADD %KEY%\005 /VE /D "Test" /fREG ADD %KEY%\005 /V 1 /D "%PP%Ztest\test.cmd" /fi dont want a SFX archive. that is my last option but i would like a cmd file instead of calling in the same runonceex. Edited December 8, 2007 by RTK999
Yzöwl Posted December 9, 2007 Posted December 9, 2007 I have removed the identical posting you've made on this subject from the Windows XP Forum area. Please do not make multiple posts with identical content.As for your topic, could you please try to explain better what you are trying to do. You appear to have both asked a question and answered it in the same post. If there is something which is not working then tell us what it is you've done and what the result is so that we are better equipped to help you.
RTK999 Posted December 9, 2007 Author Posted December 9, 2007 sorry for my first post i didnt wanna make it that just i wrote the first post in a wrong forum.The question is :I want to run the xcopy command from a batch file and then call the batch file from RunOnceEx.The problem is that i dont make the xcopy command work in th batch file i tried everything but nothing happened.I dont want to run the xcopy command from the RunOnceEx file.
Yzöwl Posted December 9, 2007 Posted December 9, 2007 This command inside your NT Command Script should work fine.XCOPY Data %SYSTEMDRIVE%\Ztest\Data /E/Y/I.From the code you've provided it does appear that your Data folder is in the correct location in relation to the script and your runonceex command line appears to be correct.Try changing the command line to that which I've provided and report back with your results.
RTK999 Posted December 9, 2007 Author Posted December 9, 2007 Well its work fine know i put this in my batch file:@echo offFOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\CD.txt SET CDROM=%%i:SET PP=%CDROM%\Software\XCOPY %PP%\Aimp2\Data /E /I /Y "%SYSTEMDRIVE%\Archivos de programa\AIMP2\Data\"EXITand then call it from my Runonceex from cd:@Echo OffFOR %%i IN (D E F G H I J K L M N O P Q R S T U V W X Y Z) DO IF EXIST %%i:\CD.txt SET CDROM=%%i:SET PP=%CDROM%\Software\SET KEY=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnceExREG ADD %KEY% /V TITLE /D "Softwares List" /fREG ADD %KEY%\001 /VE /D "Start..." /fREG ADD %KEY%\005 /VE /D "Aimp2" /fREG ADD %KEY%\005 /V 1 /D "%PP%Aimp2\test.cmd" /fEXITthanks Yzöwl for support, this is a bit more work but is more ordered the runonceex
Yzöwl Posted December 9, 2007 Posted December 9, 2007 I'm glad you've got it sorted.Try to learn to optimize your code a little too!e.g.@echo offFOR %%i IN ( D E F G H I J K L M N O P Q R S T U V W X Y Z ) DO IF EXIST %%i:\CD.txt SET "PP=%%i:\Software\Aimp2\Data"XCOPY %PP% "%PROGRAMFILES%\AIMP2\Data" /E/I/YAs you can see, since you weren't actually using %CDROM% you didn't need to create it as a variable!
RTK999 Posted December 9, 2007 Author Posted December 9, 2007 ok thank a lot i'm starting and i learn its for myself
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now