mecablaze Posted August 27, 2008 Share Posted August 27, 2008 Ok. I've posted a related topic in the nLite section, but this forum seems more appropriote for this specific problem I'm having.Okay, so I have a batch file on my windows XP cd called start.bat (the path is %SOURCE%\RunOnce\start.bat). Also in this directory is all files necessary for running wget. This batch file makes a directory on the current user's desktop (successfully) and copies all of the wget .exe's and .dll's to the new directory on the desktop. The batch then changes directory to that new directory and runs a single wget command. When the batch file get's this far, it tries to run the wget command, but access is denied. wget.exe cannot write to the new folder. I figured it was a problem with wget, but then I tried a simple "echo test > test.txt" right before the wget command. Access was denied in the statement too. What it looks like to me is batch files running from a CD do not invoke write priviledges. Has anyone else has this problem? Link to comment Share on other sites More sharing options...
Yzöwl Posted August 27, 2008 Share Posted August 27, 2008 I would suggest that for problems arising from or related to a batch file it would be prudent to supply both the batch file and a run down of the relevant file/directory structure. Link to comment Share on other sites More sharing options...
mecablaze Posted August 28, 2008 Author Share Posted August 28, 2008 (edited) My bad. I guess I just figured this problem was one you could take pretty much out of context. Here's some info.nLite GuiRunOnce command:%SOURCE%\RunOnce\start.batContents of RunOnce directory:libeay32.dllmsvcr71.dllmsvcr80.dllopenssl.exessleay32.dllstart.batwget.exeContents of start.bat@echo offfor /f "tokens=3 delims=\" %%i in ("%USERPROFILE%") do (set user=%%i) 2>&1echo Creating an instance of wget on user desktop...@mkdir "C:\Documents and Settings\%user%\Desktop\download"@copy libeay32.dll "C:\Documents and Settings\%user%\Desktop\download\libeay32.dll"@copy msvcr71.dll "C:\Documents and Settings\%user%\Desktop\download\msvcr71.dll"@copy msvcr80.dll "C:\Documents and Settings\%user%\Desktop\download\msvcr80.dll"@copy openssl.exe "C:\Documents and Settings\%user%\Desktop\download\openssl.exe"@copy ssleay32.dll "C:\Documents and Settings\%user%\Desktop\download\ssleay32.dll"@copy wget.exe "C:\Documents and Settings\%user%\Desktop\download\wget.exe"cd C:\Documents and Settings\%user%\Desktop\download\:: the following line is where I got the first access denied error...wget --no-cache --no-clobber --tries 3 --user-agent="Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1) Gecko/2008070208 Firefox/3.0.1" "http://somewhere.com/sandbox/winget/build.php":: so I tried this line thinking it was a problem with wget, but the following line throws an access denied as wellecho test > test.txt ren "build.php" "download.bat"download.batTell me if you need any more information I can provide you with. Edited August 28, 2008 by Yzöwl as stated in my response Link to comment Share on other sites More sharing options...
jjvs Posted August 28, 2008 Share Posted August 28, 2008 (edited) Try and change the commandcd C:\Documents and Settings\%user%\Desktop\download\tocd /D C:\Documents and Settings\%user%\Desktop\download\This will also change your driveletter.Or add -P "C:\Documents and Settings\%user%\Desktop\download\" to your wget cmdline. This will download everything to the directory behind "-P".Hope it'll help.edit: Changed "-p" to '-P" Edited August 28, 2008 by jjvs Link to comment Share on other sites More sharing options...
Yzöwl Posted August 28, 2008 Share Posted August 28, 2008 First the good news, I've tried your batch file and it works fine for me based upon %source% being %UserProfile%\Desktop\RunOnce.I've given your batch file a quick rewrite which also works for me from the same %source%@Echo off&SetlocalSet "X_=_X.lst"(Set Y_=--no-cache --no-clobber --tries 3 --user-agent=^")Set "Y_=%Y_%Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.1)"(Set Y_=%Y_% Gecko/2008070208 Firefox/3.0.1")(Set Y_=%Y_% "http://somewhere.com/sandbox/winget/build.php")Echo:Creating an instance of wget on user desktop...>%X_% (Echo:%~nx0&Echo:%X_%)Xcopy *.* "%UserProfile%\Desktop\download" /i/exclude:_X.lst&&Del _X.lst Pushd %UserProfile%\Desktop\downloadWget %Y_%&If Not Errorlevel 1 (Ren "build.php" "download.bat"&Echo:download.bat)Now the bad news, your download is in fact warez related and as such you are in breach of the rules! Link to comment Share on other sites More sharing options...
Recommended Posts