MSFN Forum: Problems with WPI and some Filenames - MSFN Forum

Jump to content



Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Problems with WPI and some Filenames Rate Topic: -----

#1 User is offline   Jackson0 

  • Newbie
  • Group: Members
  • Posts: 19
  • Joined: 02-December 08

Posted 23 January 2009 - 06:40 PM

Hi,

I have some problems with files that will not be moved or deletet. :wacko: Files positions are correct.

%AllUsersProfile%\Startmenü\Programme\Acronis\Acronis True Image Home" is a folder.

{MAKEDIR} "%AllUsersProfile%\Startmenü\Programme\Brenn und Festplatten Tools"
{FILEMOVE} "%AllUsersProfile%\Startmenü\Programme\Acronis\Acronis True Image Home" "%AllUsersProfile%\Startmenü\Programme\Brenn und Festplatten Tools\"

will not moved into "Brenn und Festplatten Tools" folder. Foldername is correct!

-------------------------------------------------------------------------------------------------------------------------------------------------------------------

{DELETE} "%AllUsersProfile%\Desktop\Acronis Disk Director.lnk"

will not be deletet, although there. Filename is correct!

The problem seems with long filenames and spaces between the words.

Regards
Jackson

This post has been edited by Jackson0: 23 January 2009 - 06:41 PM



#2 User is offline   johnhc 

  • MSFN Junkie
  • PipPipPipPipPipPipPipPipPip
  • Group: Members
  • Posts: 3,241
  • Joined: 02-March 08
  • OS:Windows 7 x64
  • Country: Country Flag

Posted 23 January 2009 - 07:24 PM

Jackson0, please attach (not paste) your WPIxxx.log. The xxx will be a date/time stamp and the file will be in your root (usually C:\) directory. Enjoy, John.

#3 User is offline   AlBundy33 

  • Member
  • PipPip
  • Group: Members
  • Posts: 217
  • Joined: 02-January 05

Posted 31 January 2009 - 08:00 PM

I think this is more a problem of copy and move.

To move startmenu entries I wrote a script which copies source to target and removes source.

Are you sure that the Link on the Desktop is really a lnk-file? Sometimes the shortcuts are registry-keys (like recycle bin or network)

You can try my script to move you startmenu-entries.
You need sleep.exe (or remove the line with this command).

You can call the script with move.cmd "Acronis" "Brenn und Festplatten Tools"
It searches in %USERPROFILE% AND %ALLUSERPROFILE% and creates the target-dir if necessary.

Al

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS DISABLEDELAYEDEXPANSION
IF EXIST "%SYSTEMDRIVE%\SetWPIEnv.cmd" CALL "%SYSTEMDRIVE%\SetWPIEnv.cmd"

SET SOURCE="%~1"
SET TARGET="%~2"
IF "%~3"=="" (
	SET /A LOOPS=0
) ELSE (
	SET /A LOOPS=%~3
)
IF NOT "%OVERWRITELOOPS%"=="" SET /A LOOPS=%OVERWRITELOOPS%

IF %SOURCE%=="" GOTO :HELP
IF %TARGET%=="" SET TARGET=!CD!

IF /I "%UNDOMOVE%"=="true" (
	ECHO Tausche Quelle und Ziel um die Verschiebung rueckgaengig zu machen.
	SET CHANGE=%SOURCE%
	SET SOURCE=%TARGET%
	SET TARGET=%CHANGE%
	SET CHANGE=
)

IF %SOURCE%==%SOURCE:\=% (
	CALL :WAIT "%ALLUSERSPROFILE%\STARTM~1\Programme\%SOURCE:~1,-1%" "%USERPROFILE%\STARTM~1\Programme\%SOURCE:~1,-1%"

	IF %TARGET%==%TARGET:\=% (
		CALL :MOVE "%ALLUSERSPROFILE%\STARTM~1\Programme\%SOURCE:~1,-1%" "%ALLUSERSPROFILE%\STARTM~1\Programme\%TARGET:~1,-1%"
	) ELSE (
		CALL :MOVE "%ALLUSERSPROFILE%\STARTM~1\Programme\%SOURCE:~1,-1%" "%TARGET:~1,-1%"
	)

	IF %TARGET%==%TARGET:\=% (
		CALL :MOVE "%USERPROFILE%\STARTM~1\Programme\%SOURCE:~1,-1%" "%USERPROFILE%\STARTM~1\Programme\%TARGET:~1,-1%"
	) ELSE (
		CALL :MOVE "%USERPROFILE%\STARTM~1\Programme\%SOURCE:~1,-1%" "%TARGET:~1,-1%"
	)
) ELSE (
	CALL :WAIT %SOURCE%
	CALL :MOVE %SOURCE% %TARGET%
)

GOTO :END

:WAIT
	SET FOUND=false
	:LOOP
		FOR %%X IN (%*) DO (
			IF EXIST "%%~X" SET FOUND=true
		)
		IF /I "%FOUND%"=="true" GOTO :NEXT
		IF %LOOPS% LEQ 0 GOTO :NEXT
		ECHO Warte bis Quelle existiert ^(%LOOPS%^)...
		"%~dp0sleep.exe" 1
		SET /A LOOPS-=1
		GOTO :LOOP
	:NEXT
	IF %LOOPS% LEQ 0 (
		CALL :ERRORMSG "Quelle existiert nicht."
		GOTO :END
	)
	GOTO :EOF

:MOVE
	SET SRC="%~1"
	SET DEST="%~2"
	IF NOT EXIST %SRC% GOTO :END

	DIR /A:D %SRC% >NUL 2>NUL
	IF %ERRORLEVEL%==1 (
		SET ISFILE=TRUE
	) ELSE (
		SET ISFILE=FALSE
	)

	SET PARAMS=/V /I /F /G /H /R /Y

	IF NOT EXIST %DEST% MD %DEST%
	IF /I %ISFILE%==FALSE (
		IF "%SRC:~-2,1%"=="\" SET SOURCE="%SRC:~1,-2%"
		IF "%DEST:~-2,1%"=="\" SET TARGET="%DEST:~1,-2%"
		FOR %%T IN (%SRC%) DO SET DEST="%DEST:~1,-1%\%%~nxT"
		SET PARAMS=%PARAMS% /E
	)
	IF NOT EXIST %DEST% MD %DEST%

	XCOPY %PARAMS% %SRC% %DEST%

	IF NOT %ERRORLEVEL%==0 (
		CALL :ERRORMSG "Es ist ein Fehler (ERRORLEVEL: %ERRORLEVEL%) aufgetreten."
		GOTO :END
	)

	IF %ISFILE%==TRUE (
		DEL /F /Q %SRC%
	) ELSE (
		RD /S /Q %SRC%
	)

	GOTO :END

:HELP
	ECHO.Anwendung: %~nx0 source [target]
	ECHO.
	GOTO :END

:ERRORMSG
	ECHO FEHLER: %~1
	GOTO :EOF

:END
	ENDLOCAL


Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



All trademarks mentioned on this page are the property of their respective owners
Copyright © 2001 - 2011 msfn.org
Privacy Policy