MSFN Forum: run syncronouscommand local - MSFN Forum

Jump to content


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

run syncronouscommand local without having to specify drive letter Rate Topic: -----

#1 User is offline   Jadestar 

  • Member
  • PipPip
  • Group: Members
  • Posts: 106
  • Joined: 07-November 07

Posted 05 February 2010 - 12:47 PM

Ok so lets say I need to run syncronouscommand to run some files...but lets say I dont know what drive letter they will be, but the file will ALWAYS be on the same drive that vista is installing from.

For example, the dvd drive could be D or it could be E

...this is actually going on from a memory stick and the drive letter changes..either way, my question is,

when runsyncrnouscommand runs, what path is it executing from. Does it run from the root of the drive or from sources?

So another example, if runsyncrouscommand was running from the root, and my app was in a folder called apps on the root then the <path> would simply be /apps/file.exe

So you see what I mean about not specifying drive letter.

<RunSynchronousCommand wcm:action="add">
<Description>Copyapps</Description>
<Path>D:\programs\copyappsvista.cmd</Path>
<Order>1</Order>
<WillReboot>Never</WillReboot>
</RunSynchronousCommand>

So basically I want to be able to run copyappsvista.cmd without specifying drive letter, but whatever drive letter it is, the rest of the path will be the same.

I cant use %cdrom or %dvdrom flags because this is running from a flash drive.

Thanks in advanced.


#2 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,665
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 05 February 2010 - 05:57 PM

I can think of 2 options:

1. Have your install copy the program to install to the hard drive. Then write a wrapper (you can use AutoIT) that installs the program and then deletes the install files when it is done.
2. Put your app on a network share. Map the drive and then your drive letter shouldn't ever change.

#3 User is offline   MrJinje 

  • Tool™ Developer
  • Group: Developers
  • Posts: 942
  • Joined: 14-October 09
  • OS:none specified
  • Country: Country Flag

  Posted 06 February 2010 - 12:35 AM

3) use the old for loop around the alphabet trick, or just go read it from the registry.

View Postgunsmokingman, on Jun 10 2005, 05:07 AM, said:

For The Cdrom you need to set the varible for it
Here are 2 different ways to do it,

Quote

FOR /F "TOKENS=3" %%I IN ('REG QUERY "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SourcePath" ^| FINDSTR "SourcePath"') DO SET CDROM=%%~dI


Quote

for %%i in (C: 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\SETUP.exe set CDROM=%%i

UPDATED FOR 7:
 
for %%i in (C: 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\sources\install.wim set MEDIA=%%i
ECHO %MEDIA% 


EDIT: and you can use the CDROM variable with a USB disk, in fact you can call the variable anything you like, CDROM, MEDIA, it doesn't make any difference. As long as you use the same name later in the script when you try to access the variable. capisce

This post has been edited by MrJinje: 06 February 2010 - 01:03 PM


#4 User is offline   Jadestar 

  • Member
  • PipPip
  • Group: Members
  • Posts: 106
  • Joined: 07-November 07

Posted 18 February 2010 - 10:59 AM

thanks muchly.

i decided to go with cmdlines that copies all my install files to the c drive (for some reason the $ folders arent working) and then running it using C:\ since that never changes (except with stupid card readers sometimes arghhhh).

thanks again

#5 User is offline   Jadestar 

  • Member
  • PipPip
  • Group: Members
  • Posts: 106
  • Joined: 07-November 07

Posted 22 February 2010 - 12:24 PM

my mistake. I realized that i posted this question for vista and my solution was for xp (yeah im busy...getting confused between projects). so...i guess it isnt fixed.

So is there no way to just not use a drive letter?

for example, if my working directory was D:\sources and i specified \install\run.exe then the working path would be D:\sources\install\run.exe

See what I mean?

Quote

1. Have your install copy the program to install to the hard drive. Then write a wrapper (you can use AutoIT) that installs the program and then deletes the install files when it is done.


Well thats what I want to do, but i need to run a program to do that copying.

#6 User is offline   Jadestar 

  • Member
  • PipPip
  • Group: Members
  • Posts: 106
  • Joined: 07-November 07

Posted 22 February 2010 - 12:40 PM

Im going to go ahead and say that on my cmdlines for xp, i am using D:\programs\copyapps.cmd so i guess i've been using a drive letter the whole time and it hasnt broken yet..so i'll just go ahead and do that for vista and pray it doesnt break ;)

#7 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,665
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 23 February 2010 - 09:37 AM

View PostJadestar, on 22 February 2010 - 12:40 PM, said:

Im going to go ahead and say that on my cmdlines for xp, i am using D:\programs\copyapps.cmd so i guess i've been using a drive letter the whole time and it hasnt broken yet..so i'll just go ahead and do that for vista and pray it doesnt break ;)


Remember that Vista may use different registry paths and DOES use different paths for the User profile and Programs, since there are no Documents and Settings or Program Files folders anymore. So if you are using any absolute paths for XP, you may need to change them. Easiest might be to detect which type of OS it is, and use one method for XP and the other for Vista.

#8 User is offline   Jadestar 

  • Member
  • PipPip
  • Group: Members
  • Posts: 106
  • Joined: 07-November 07

Posted 23 February 2010 - 01:40 PM

Ok so apparently in vista, it doesnt like my D:\Install\copyapps.cmd
I'm guessing its a problem with drive letters. works in xp no problem but for whatever reason, it doesnt here. SO I need a solution. What would be helpfull is knowing the working directory and put my copyapps.cmd in that and then use the patch \workingpath\copyapps.cmd instead of D:\install\copyapps.cmd

The problem is that this will be run on multiple computers, so while the main drive install will always be C:, the flash drive could be anything else.

#9 User is offline   Tripredacus 

  • K-Mart-ian Legend
  • Group: Super Moderator
  • Posts: 8,665
  • Joined: 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Posted 24 February 2010 - 10:22 AM

If you are running this from Normal Mode (aka not Factory or Audit Mode) you may need to run this CMD elevated. I believe you can specify a runas option in a batch file. I've never done it myself.

#10 User is offline   Jadestar 

  • Member
  • PipPip
  • Group: Members
  • Posts: 106
  • Joined: 07-November 07

Posted 25 February 2010 - 11:57 AM

I found the solution, using $OEM$ folders in vista. I thought I read someonewhere else that this method didnt work in vista but it definately does, theres just a flag you have to enable in autounattend.xml. So now all my folders get copied to the root of the harddrive, which is always C: and then the commands run stuff from C: which works everytime.

Thanks for all the input guys.

*now i wonder why my $oem$ folders didnt work in xp..;)

Share this topic:


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

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



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