liorshwa Posted June 27, 2013 Share Posted June 27, 2013 i have a .bat file that contains the following:cd "%windir%\resources\themes\Embedded"Embedded.msstylesWinWait("Display Properties", "", 5)cd "%userprofile%\desktop"ThemeChange.exeand when i run it from the desktop it works but when i run the same file from my USB Flash drive it says:Embedded.msstyles" is not recognized as an internal or external command.can some1 help me PLZ Link to comment Share on other sites More sharing options...
gonza Posted June 28, 2013 Share Posted June 28, 2013 The search will still be on your USB stick. You need to reference the drive as well.Assuming C: is the Windows driveOne way would be:cd "%windir%\resources\themes\Embedded"C:Embedded.msstylesC:WinWait("Display Properties", "", 5)cd "%userprofile%\desktop"C:ThemeChange.exeOR (something like)cd "%windir%\resources\themes\Embedded""%windir%\resources\themes\Embedded\Embedded.msstyles""%windir%\resources\themes\Embedded\WinWait("Display Properties", "", 5)"cd "%userprofile%\desktop""%userprofile%\desktop\ThemeChange.exe"OR (on my system I note that both %homedrive% and %systemdrive" returns C:)I think this is probably the "proper" way to do it:cd "%windir%\resources\themes\Embedded"%systemdrive%Embedded.msstyles%systemdrive%WinWait("Display Properties", "", 5)cd "%userprofile%\desktop"%systemdrive%ThemeChange.exeIF you fire up a cmd window, type "set" and you'll see a bunch of useful environment variablesI'm making some guesses in my interpretation of your batch file, but I hope that I've given you the gist of what to try. Good luck. Link to comment Share on other sites More sharing options...
gonza Posted June 28, 2013 Share Posted June 28, 2013 Ooops. Even easier, just add %systemdrive% at the start of you batch file. That'll make e.g. C: be the current drive. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.