@@ -223,7 +223,7 @@ public JContainer AttachCommand([FromBody]dynamic cmd)
223223 Utils . ConnectToRemote ( share . UncPath , share . Domain , share . User , share . Password ) ;
224224
225225 // The share is mapped, now attach the iso
226- string isoPath = Path . Combine ( share . UncPath . Replace ( '/' , Path . DirectorySeparatorChar ) , dataStore . path ) ;
226+ string isoPath = Utils . NormalizePath ( Path . Combine ( share . UncPath , dataStore . path ) ) ;
227227 wmiCallsV2 . AttachIso ( vmName , isoPath ) ;
228228 result = true ;
229229 }
@@ -267,8 +267,7 @@ public JContainer DetachCommand([FromBody]dynamic cmd)
267267 {
268268 NFSTO share = dataStore . nfsDataStoreTO ;
269269 // The share is mapped, now attach the iso
270- string isoPath = Path . Combine ( share . UncPath . Replace ( '/' , Path . DirectorySeparatorChar ) ,
271- dataStore . path . Replace ( '/' , Path . DirectorySeparatorChar ) ) ;
270+ string isoPath = Utils . NormalizePath ( Path . Combine ( share . UncPath , dataStore . path ) ) ;
272271 wmiCallsV2 . DetachDisk ( vmName , isoPath ) ;
273272 result = true ;
274273 }
@@ -957,7 +956,7 @@ public JContainer StartCommand([FromBody]dynamic cmd)
957956 share . uri = new Uri ( uriStr ) ;
958957 string defaultDataPath = wmiCallsV2 . GetDefaultDataRoot ( ) ;
959958
960- string secondaryPath = Path . Combine ( share . UncPath , "systemvm" ) . Replace ( @"/" , @"\" ) ;
959+ string secondaryPath = Utils . NormalizePath ( Path . Combine ( share . UncPath , "systemvm" ) ) ;
961960 string [ ] choices = choices = Directory . GetFiles ( secondaryPath , "systemvm*.iso" ) ;
962961 if ( choices . Length != 1 )
963962 {
@@ -966,7 +965,7 @@ public JContainer StartCommand([FromBody]dynamic cmd)
966965 }
967966 else
968967 {
969- systemVmIsoPath = Path . Combine ( defaultDataPath , Path . GetFileName ( choices [ 0 ] ) ) ;
968+ systemVmIsoPath = Utils . NormalizePath ( Path . Combine ( defaultDataPath , Path . GetFileName ( choices [ 0 ] ) ) ) ;
970969 if ( ! File . Exists ( systemVmIsoPath ) )
971970 {
972971 Utils . DownloadCifsFileToLocalFile ( choices [ 0 ] , share , systemVmIsoPath ) ;
@@ -1057,7 +1056,7 @@ public JContainer CreateObjectCommand([FromBody]dynamic cmd)
10571056 else
10581057 {
10591058 volumePath = @"\\" + primary . uri . Host + primary . uri . LocalPath + @"\" + volumeName ;
1060- volumePath = volumePath . Replace ( '/' , ' \\ ' ) ;
1059+ volumePath = Utils . NormalizePath ( volumePath ) ;
10611060 Utils . ConnectToRemote ( primary . UncPath , primary . Domain , primary . User , primary . Password ) ;
10621061 }
10631062
0 commit comments